From c067cda96fe691a023de60537c442dd772e2e4a7 Mon Sep 17 00:00:00 2001 From: jolov Date: Tue, 5 Aug 2025 20:19:59 -0700 Subject: [PATCH 1/7] WIP --- .../CHANGELOG.md | 8 + ...re.Messaging.EventGrid.SystemEvents.csproj | 4 +- .../Customization/AcsCallEndedEventData.cs | 1 - .../AcsChatThreadCreatedEventData.cs | 1 - .../AcsChatThreadCreatedWithUserEventData.cs | 1 - ...AcsChatThreadPropertiesUpdatedEventData.cs | 1 - ...ThreadPropertiesUpdatedPerUserEventData.cs | 1 - .../AcsCommunicationIdentifierKind.cs | 2 +- .../src/Customization/AcsMessageEventData.cs | 3 - .../AcsMicrosoftTeamsAppIdentifier.cs | 4 +- ...sRouterJobClassificationFailedEventData.cs | 4 +- .../Customization/AcsRouterJobEventData.cs | 16 + .../AcsRouterJobReceivedEventData.cs | 2 +- ...agementGatewayTokenNearExpiryProperties.cs | 4 +- .../src/Customization/AppAction.cs | 2 +- .../AppConfigurationSnapshotEventData.cs | 4 +- .../src/Customization/AppServicePlanAction.cs | 7 +- .../Customization/EventGridModelFactory.cs | 15 +- .../EventGridMqttClientDisconnectionReason.cs | 2 +- .../ResourceActionCancelEventData.cs | 6 +- .../ResourceActionFailureEventData.cs | 6 +- .../ResourceActionSuccessEventData.cs | 6 +- .../ResourceDeleteCancelEventData.cs | 6 +- .../ResourceDeleteFailureEventData.cs | 6 +- .../ResourceDeleteSuccessEventData.cs | 6 +- .../ResourceWriteCancelEventData.cs | 6 +- .../ResourceWriteFailureEventData.cs | 4 +- .../ResourceWriteSuccessEventData.cs | 4 +- .../src/Customization/StampKind.cs | 2 +- .../UnknownMediaJobOutput.Serialization.cs | 4 - ...csCallEndReasonProperties.Serialization.cs | 101 +- .../Generated/AcsCallEndReasonProperties.cs | 41 +- .../src/Generated/AcsCallEndedByKind.cs | 37 +- .../AcsCallEndedByProperties.Serialization.cs | 104 +- .../src/Generated/AcsCallEndedByProperties.cs | 50 +- .../AcsCallEndedEventData.Serialization.cs | 172 +- .../src/Generated/AcsCallEndedEventData.cs | 16 +- .../AcsCallGroupProperties.Serialization.cs | 89 +- .../src/Generated/AcsCallGroupProperties.cs | 39 +- ...ParticipantAddedEventData.Serialization.cs | 178 +- .../AcsCallParticipantAddedEventData.cs | 13 +- ...sCallParticipantEventData.Serialization.cs | 178 +- .../Generated/AcsCallParticipantEventData.cs | 16 +- .../src/Generated/AcsCallParticipantKind.cs | 49 +- ...CallParticipantProperties.Serialization.cs | 97 +- .../Generated/AcsCallParticipantProperties.cs | 40 +- ...rticipantRemovedEventData.Serialization.cs | 178 +- .../AcsCallParticipantRemovedEventData.cs | 13 +- .../AcsCallRoomProperties.Serialization.cs | 89 +- .../src/Generated/AcsCallRoomProperties.cs | 39 +- .../AcsCallStartedEventData.Serialization.cs | 134 +- .../src/Generated/AcsCallStartedEventData.cs | 13 +- ...AcsCallingEventProperties.Serialization.cs | 128 +- .../Generated/AcsCallingEventProperties.cs | 57 +- ...ReceivedInThreadEventData.Serialization.cs | 180 +- ...zureBotCommandReceivedInThreadEventData.cs | 21 +- ...csChatEventBaseProperties.Serialization.cs | 100 +- .../Generated/AcsChatEventBaseProperties.cs | 50 +- ...entInThreadBaseProperties.Serialization.cs | 96 +- .../AcsChatEventInThreadBaseProperties.cs | 48 +- ...atMessageDeletedEventData.Serialization.cs | 164 +- .../AcsChatMessageDeletedEventData.cs | 17 +- ...eDeletedInThreadEventData.Serialization.cs | 158 +- .../AcsChatMessageDeletedInThreadEventData.cs | 16 +- ...hatMessageEditedEventData.Serialization.cs | 200 +- .../AcsChatMessageEditedEventData.cs | 23 +- ...geEditedInThreadEventData.Serialization.cs | 200 +- .../AcsChatMessageEditedInThreadEventData.cs | 22 +- ...essageEventBaseProperties.Serialization.cs | 142 +- .../AcsChatMessageEventBaseProperties.cs | 27 +- ...entInThreadBaseProperties.Serialization.cs | 130 +- ...sChatMessageEventInThreadBaseProperties.cs | 26 +- ...tMessageReceivedEventData.Serialization.cs | 192 +- .../AcsChatMessageReceivedEventData.cs | 22 +- ...ReceivedInThreadEventData.Serialization.cs | 180 +- ...AcsChatMessageReceivedInThreadEventData.cs | 21 +- ...antAddedToThreadEventData.Serialization.cs | 138 +- ...csChatParticipantAddedToThreadEventData.cs | 17 +- ...ToThreadWithUserEventData.Serialization.cs | 148 +- ...rticipantAddedToThreadWithUserEventData.cs | 17 +- ...emovedFromThreadEventData.Serialization.cs | 138 +- ...atParticipantRemovedFromThreadEventData.cs | 17 +- ...omThreadWithUserEventData.Serialization.cs | 148 +- ...ipantRemovedFromThreadWithUserEventData.cs | 17 +- ...hatThreadCreatedEventData.Serialization.cs | 200 +- .../AcsChatThreadCreatedEventData.cs | 22 +- ...dCreatedWithUserEventData.Serialization.cs | 212 +- .../AcsChatThreadCreatedWithUserEventData.cs | 23 +- ...hatThreadDeletedEventData.Serialization.cs | 138 +- .../AcsChatThreadDeletedEventData.cs | 14 +- ...ThreadEventBaseProperties.Serialization.cs | 120 +- .../AcsChatThreadEventBaseProperties.cs | 13 +- ...entInThreadBaseProperties.Serialization.cs | 116 +- ...csChatThreadEventInThreadBaseProperties.cs | 12 +- ...readParticipantProperties.Serialization.cs | 118 +- .../AcsChatThreadParticipantProperties.cs | 51 +- ...ropertiesUpdatedEventData.Serialization.cs | 192 +- ...AcsChatThreadPropertiesUpdatedEventData.cs | 25 +- ...esUpdatedPerUserEventData.Serialization.cs | 208 +- ...ThreadPropertiesUpdatedPerUserEventData.cs | 23 +- ...dWithUserDeletedEventData.Serialization.cs | 148 +- .../AcsChatThreadWithUserDeletedEventData.cs | 15 +- ...ReceivedInThreadEventData.Serialization.cs | 180 +- ...ypingIndicatorReceivedInThreadEventData.cs | 21 +- .../AcsCommunicationIdentifierKind.cs | 49 +- ...ryReportReceivedEventData.Serialization.cs | 134 +- ...AcsEmailDeliveryReportReceivedEventData.cs | 56 +- .../Generated/AcsEmailDeliveryReportStatus.cs | 53 +- ...liveryReportStatusDetails.Serialization.cs | 93 +- .../AcsEmailDeliveryReportStatusDetails.cs | 40 +- ...ngReportReceivedEventData.Serialization.cs | 135 +- ...gagementTrackingReportReceivedEventData.cs | 45 +- ...IncomingCallCustomContext.Serialization.cs | 128 +- .../Generated/AcsIncomingCallCustomContext.cs | 55 +- .../AcsIncomingCallEventData.Serialization.cs | 144 +- .../src/Generated/AcsIncomingCallEventData.cs | 56 +- .../src/Generated/AcsInteractiveReplyKind.cs | 41 +- .../AcsMessageButtonContent.Serialization.cs | 93 +- .../src/Generated/AcsMessageButtonContent.cs | 40 +- ...sMessageChannelEventError.Serialization.cs | 92 +- .../Generated/AcsMessageChannelEventError.cs | 41 +- .../src/Generated/AcsMessageChannelKind.cs | 33 +- .../AcsMessageContext.Serialization.cs | 95 +- .../src/Generated/AcsMessageContext.cs | 40 +- .../src/Generated/AcsMessageDeliveryStatus.cs | 53 +- ...eryStatusUpdatedEventData.Serialization.cs | 152 +- ...csMessageDeliveryStatusUpdatedEventData.cs | 16 +- .../AcsMessageEventData.Serialization.cs | 128 +- .../src/Generated/AcsMessageEventData.cs | 52 +- ...ractiveButtonReplyContent.Serialization.cs | 95 +- ...AcsMessageInteractiveButtonReplyContent.cs | 40 +- ...MessageInteractiveContent.Serialization.cs | 105 +- .../Generated/AcsMessageInteractiveContent.cs | 41 +- ...teractiveListReplyContent.Serialization.cs | 99 +- .../AcsMessageInteractiveListReplyContent.cs | 41 +- .../AcsMessageMediaContent.Serialization.cs | 114 +- .../src/Generated/AcsMessageMediaContent.cs | 52 +- ...AcsMessageReactionContent.Serialization.cs | 96 +- .../Generated/AcsMessageReactionContent.cs | 48 +- ...sMessageReceivedEventData.Serialization.cs | 204 +- .../Generated/AcsMessageReceivedEventData.cs | 24 +- ...crosoftTeamsAppIdentifier.Serialization.cs | 98 +- .../AcsMicrosoftTeamsAppIdentifier.cs | 48 +- .../src/Generated/AcsRecordingChannelType.cs | 37 +- ...ordingChunkInfoProperties.Serialization.cs | 111 +- .../AcsRecordingChunkInfoProperties.cs | 44 +- .../src/Generated/AcsRecordingContentType.cs | 37 +- ...ileStatusUpdatedEventData.Serialization.cs | 152 +- .../AcsRecordingFileStatusUpdatedEventData.cs | 53 +- .../src/Generated/AcsRecordingFormatType.cs | 41 +- ...dingStorageInfoProperties.Serialization.cs | 91 +- .../AcsRecordingStorageInfoProperties.cs | 39 +- ...outerChannelConfiguration.Serialization.cs | 101 +- .../AcsRouterChannelConfiguration.cs | 41 +- ...sRouterCommunicationError.Serialization.cs | 109 +- .../Generated/AcsRouterCommunicationError.cs | 52 +- .../AcsRouterEventData.Serialization.cs | 111 +- .../src/Generated/AcsRouterEventData.cs | 41 +- ...uterJobCancelledEventData.Serialization.cs | 160 +- .../AcsRouterJobCancelledEventData.cs | 13 +- ...sificationFailedEventData.Serialization.cs | 176 +- ...sRouterJobClassificationFailedEventData.cs | 15 +- ...terJobClassifiedEventData.Serialization.cs | 190 +- .../AcsRouterJobClassifiedEventData.cs | 17 +- ...sRouterJobClosedEventData.Serialization.cs | 160 +- .../Generated/AcsRouterJobClosedEventData.cs | 14 +- ...uterJobCompletedEventData.Serialization.cs | 160 +- .../AcsRouterJobCompletedEventData.cs | 13 +- ...RouterJobDeletedEventData.Serialization.cs | 158 +- .../Generated/AcsRouterJobDeletedEventData.cs | 12 +- .../AcsRouterJobEventData.Serialization.cs | 168 +- .../src/Generated/AcsRouterJobEventData.cs | 17 +- ...ceptionTriggeredEventData.Serialization.cs | 160 +- ...AcsRouterJobExceptionTriggeredEventData.cs | 13 +- ...sRouterJobQueuedEventData.Serialization.cs | 192 +- .../Generated/AcsRouterJobQueuedEventData.cs | 15 +- ...outerJobReceivedEventData.Serialization.cs | 218 +- .../AcsRouterJobReceivedEventData.cs | 16 +- ...SchedulingFailedEventData.Serialization.cs | 216 +- .../AcsRouterJobSchedulingFailedEventData.cs | 17 +- .../src/Generated/AcsRouterJobStatus.cs | 65 +- ...terJobUnassignedEventData.Serialization.cs | 160 +- .../AcsRouterJobUnassignedEventData.cs | 13 +- ...ingForActivationEventData.Serialization.cs | 216 +- ...sRouterJobWaitingForActivationEventData.cs | 17 +- ...SelectorsExpiredEventData.Serialization.cs | 184 +- ...outerJobWorkerSelectorsExpiredEventData.cs | 14 +- .../src/Generated/AcsRouterLabelOperator.cs | 53 +- .../AcsRouterQueueDetails.Serialization.cs | 116 +- .../src/Generated/AcsRouterQueueDetails.cs | 53 +- .../AcsRouterUpdatedWorkerProperty.cs | 53 +- ...terWorkerDeletedEventData.Serialization.cs | 109 +- .../AcsRouterWorkerDeletedEventData.cs | 4 +- ...rkerDeregisteredEventData.Serialization.cs | 103 +- .../AcsRouterWorkerDeregisteredEventData.cs | 39 +- .../AcsRouterWorkerEventData.Serialization.cs | 109 +- .../src/Generated/AcsRouterWorkerEventData.cs | 4 +- ...kerOfferAcceptedEventData.Serialization.cs | 240 +- .../AcsRouterWorkerOfferAcceptedEventData.cs | 32 +- ...kerOfferDeclinedEventData.Serialization.cs | 121 +- .../AcsRouterWorkerOfferDeclinedEventData.cs | 5 +- ...rkerOfferExpiredEventData.Serialization.cs | 121 +- .../AcsRouterWorkerOfferExpiredEventData.cs | 5 +- ...orkerOfferIssuedEventData.Serialization.cs | 248 +- .../AcsRouterWorkerOfferIssuedEventData.cs | 33 +- ...rkerOfferRevokedEventData.Serialization.cs | 121 +- .../AcsRouterWorkerOfferRevokedEventData.cs | 5 +- ...WorkerRegisteredEventData.Serialization.cs | 164 +- .../AcsRouterWorkerRegisteredEventData.cs | 59 +- .../AcsRouterWorkerSelector.Serialization.cs | 130 +- .../src/Generated/AcsRouterWorkerSelector.cs | 52 +- .../Generated/AcsRouterWorkerSelectorState.cs | 37 +- ...terWorkerUpdatedEventData.Serialization.cs | 170 +- .../AcsRouterWorkerUpdatedEventData.cs | 60 +- ...DeliveryAttemptProperties.Serialization.cs | 103 +- .../AcsSmsDeliveryAttemptProperties.cs | 41 +- ...ryReportReceivedEventData.Serialization.cs | 152 +- .../AcsSmsDeliveryReportReceivedEventData.cs | 20 +- ...AcsSmsEventBaseProperties.Serialization.cs | 100 +- .../Generated/AcsSmsEventBaseProperties.cs | 51 +- .../AcsSmsReceivedEventData.Serialization.cs | 132 +- .../src/Generated/AcsSmsReceivedEventData.cs | 17 +- ...UserDisconnectedEventData.Serialization.cs | 106 +- .../Generated/AcsUserDisconnectedEventData.cs | 47 +- .../src/Generated/AcsUserEngagement.cs | 37 +- ...iDefinitionAddedEventData.Serialization.cs | 116 +- .../ApiCenterApiDefinitionAddedEventData.cs | 49 +- ...efinitionUpdatedEventData.Serialization.cs | 116 +- .../ApiCenterApiDefinitionUpdatedEventData.cs | 49 +- ...ApiCenterApiSpecification.Serialization.cs | 96 +- .../Generated/ApiCenterApiSpecification.cs | 48 +- ...gementApiCreatedEventData.Serialization.cs | 103 +- .../ApiManagementApiCreatedEventData.cs | 39 +- ...gementApiDeletedEventData.Serialization.cs | 103 +- .../ApiManagementApiDeletedEventData.cs | 39 +- ...piReleaseCreatedEventData.Serialization.cs | 103 +- ...ApiManagementApiReleaseCreatedEventData.cs | 39 +- ...piReleaseDeletedEventData.Serialization.cs | 103 +- ...ApiManagementApiReleaseDeletedEventData.cs | 39 +- ...piReleaseUpdatedEventData.Serialization.cs | 103 +- ...ApiManagementApiReleaseUpdatedEventData.cs | 39 +- ...gementApiUpdatedEventData.Serialization.cs | 103 +- .../ApiManagementApiUpdatedEventData.cs | 39 +- ...uitBreakerClosedEventData.Serialization.cs | 110 +- ...ManagementCircuitBreakerClosedEventData.cs | 49 +- ...uitBreakerOpenedEventData.Serialization.cs | 110 +- ...ManagementCircuitBreakerOpenedEventData.cs | 49 +- ...tCircuitBreakerProperties.Serialization.cs | 98 +- .../ApiManagementCircuitBreakerProperties.cs | 47 +- ...redGatewayTokenProperties.Serialization.cs | 93 +- ...ManagementExpiredGatewayTokenProperties.cs | 39 +- ...tGatewayApiAddedEventData.Serialization.cs | 103 +- .../ApiManagementGatewayApiAddedEventData.cs | 39 +- ...atewayApiRemovedEventData.Serialization.cs | 103 +- ...ApiManagementGatewayApiRemovedEventData.cs | 39 +- ...AuthorityCreatedEventData.Serialization.cs | 103 +- ...wayCertificateAuthorityCreatedEventData.cs | 39 +- ...AuthorityDeletedEventData.Serialization.cs | 103 +- ...wayCertificateAuthorityDeletedEventData.cs | 39 +- ...AuthorityUpdatedEventData.Serialization.cs | 103 +- ...wayCertificateAuthorityUpdatedEventData.cs | 39 +- ...ntGatewayCreatedEventData.Serialization.cs | 103 +- .../ApiManagementGatewayCreatedEventData.cs | 39 +- ...ntGatewayDeletedEventData.Serialization.cs | 103 +- .../ApiManagementGatewayDeletedEventData.cs | 39 +- ...igurationCreatedEventData.Serialization.cs | 103 +- ...ayHostnameConfigurationCreatedEventData.cs | 39 +- ...igurationDeletedEventData.Serialization.cs | 103 +- ...ayHostnameConfigurationDeletedEventData.cs | 39 +- ...igurationUpdatedEventData.Serialization.cs | 103 +- ...ayHostnameConfigurationUpdatedEventData.cs | 39 +- ...nagementGatewayProperties.Serialization.cs | 96 +- .../ApiManagementGatewayProperties.cs | 49 +- ...ewayTokenExpiredEventData.Serialization.cs | 114 +- ...iManagementGatewayTokenExpiredEventData.cs | 49 +- ...yTokenNearExpiryEventData.Serialization.cs | 114 +- ...nagementGatewayTokenNearExpiryEventData.cs | 49 +- ...TokenNearExpiryProperties.Serialization.cs | 93 +- ...agementGatewayTokenNearExpiryProperties.cs | 39 +- ...ntGatewayUpdatedEventData.Serialization.cs | 103 +- .../ApiManagementGatewayUpdatedEventData.cs | 39 +- ...ntProductCreatedEventData.Serialization.cs | 103 +- .../ApiManagementProductCreatedEventData.cs | 39 +- ...ntProductDeletedEventData.Serialization.cs | 103 +- .../ApiManagementProductDeletedEventData.cs | 39 +- ...ntProductUpdatedEventData.Serialization.cs | 103 +- .../ApiManagementProductUpdatedEventData.cs | 39 +- ...scriptionCreatedEventData.Serialization.cs | 103 +- ...iManagementSubscriptionCreatedEventData.cs | 39 +- ...scriptionDeletedEventData.Serialization.cs | 103 +- ...iManagementSubscriptionDeletedEventData.cs | 39 +- ...scriptionUpdatedEventData.Serialization.cs | 103 +- ...iManagementSubscriptionUpdatedEventData.cs | 39 +- ...ementUserCreatedEventData.Serialization.cs | 103 +- .../ApiManagementUserCreatedEventData.cs | 39 +- ...ementUserDeletedEventData.Serialization.cs | 103 +- .../ApiManagementUserDeletedEventData.cs | 39 +- ...ementUserUpdatedEventData.Serialization.cs | 103 +- .../ApiManagementUserUpdatedEventData.cs | 39 +- .../src/Generated/AppAction.cs | 53 +- ...nKeyValueDeletedEventData.Serialization.cs | 118 +- ...ppConfigurationKeyValueDeletedEventData.cs | 53 +- ...KeyValueModifiedEventData.Serialization.cs | 124 +- ...pConfigurationKeyValueModifiedEventData.cs | 52 +- ...nSnapshotCreatedEventData.Serialization.cs | 108 +- ...ppConfigurationSnapshotCreatedEventData.cs | 13 +- ...gurationSnapshotEventData.Serialization.cs | 116 +- .../AppConfigurationSnapshotEventData.cs | 50 +- ...SnapshotModifiedEventData.Serialization.cs | 108 +- ...pConfigurationSnapshotModifiedEventData.cs | 13 +- .../AppEventTypeDetail.Serialization.cs | 91 +- .../src/Generated/AppEventTypeDetail.cs | 39 +- .../src/Generated/AppServicePlanAction.cs | 33 +- ...ervicePlanEventTypeDetail.Serialization.cs | 103 +- .../AppServicePlanEventTypeDetail.cs | 41 +- .../src/Generated/AsyncStatus.cs | 41 +- ...vsClusterCreatedEventData.Serialization.cs | 143 +- .../Generated/AvsClusterCreatedEventData.cs | 11 +- ...vsClusterDeletedEventData.Serialization.cs | 143 +- .../Generated/AvsClusterDeletedEventData.cs | 11 +- .../AvsClusterEventData.Serialization.cs | 172 +- .../src/Generated/AvsClusterEventData.cs | 50 +- ...AvsClusterFailedEventData.Serialization.cs | 155 +- .../Generated/AvsClusterFailedEventData.cs | 11 +- ...vsClusterUpdatedEventData.Serialization.cs | 143 +- .../Generated/AvsClusterUpdatedEventData.cs | 11 +- ...sClusterUpdatingEventData.Serialization.cs | 143 +- .../Generated/AvsClusterUpdatingEventData.cs | 11 +- .../AvsPrivateCloudEventData.Serialization.cs | 106 +- .../src/Generated/AvsPrivateCloudEventData.cs | 47 +- ...ivateCloudFailedEventData.Serialization.cs | 104 +- .../AvsPrivateCloudFailedEventData.cs | 11 +- ...vateCloudUpdatedEventData.Serialization.cs | 98 +- .../AvsPrivateCloudUpdatedEventData.cs | 11 +- ...ateCloudUpdatingEventData.Serialization.cs | 98 +- .../AvsPrivateCloudUpdatingEventData.cs | 11 +- ...ecutionCancelledEventData.Serialization.cs | 117 +- .../AvsScriptExecutionCancelledEventData.cs | 12 +- ...sScriptExecutionEventData.Serialization.cs | 132 +- .../Generated/AvsScriptExecutionEventData.cs | 50 +- ...tExecutionFailedEventData.Serialization.cs | 129 +- .../AvsScriptExecutionFailedEventData.cs | 12 +- ...xecutionFinishedEventData.Serialization.cs | 151 +- .../AvsScriptExecutionFinishedEventData.cs | 18 +- ...ExecutionStartedEventData.Serialization.cs | 117 +- .../AvsScriptExecutionStartedEventData.cs | 12 +- .../CommunicationCloudEnvironmentModel.cs | 41 +- ...municationIdentifierModel.Serialization.cs | 120 +- .../Generated/CommunicationIdentifierModel.cs | 53 +- ...cationUserIdentifierModel.Serialization.cs | 92 +- .../CommunicationUserIdentifierModel.cs | 47 +- ...RegistryArtifactEventData.Serialization.cs | 130 +- .../ContainerRegistryArtifactEventData.cs | 55 +- ...gistryArtifactEventTarget.Serialization.cs | 118 +- .../ContainerRegistryArtifactEventTarget.cs | 54 +- ...stryChartDeletedEventData.Serialization.cs | 122 +- .../ContainerRegistryChartDeletedEventData.cs | 14 +- ...istryChartPushedEventData.Serialization.cs | 122 +- .../ContainerRegistryChartPushedEventData.cs | 14 +- ...ntainerRegistryEventActor.Serialization.cs | 89 +- .../Generated/ContainerRegistryEventActor.cs | 39 +- ...tryEventConnectedRegistry.Serialization.cs | 92 +- ...ContainerRegistryEventConnectedRegistry.cs | 47 +- ...ontainerRegistryEventData.Serialization.cs | 148 +- .../Generated/ContainerRegistryEventData.cs | 58 +- ...ainerRegistryEventRequest.Serialization.cs | 112 +- .../ContainerRegistryEventRequest.cs | 59 +- ...tainerRegistryEventSource.Serialization.cs | 93 +- .../Generated/ContainerRegistryEventSource.cs | 40 +- ...tainerRegistryEventTarget.Serialization.cs | 120 +- .../Generated/ContainerRegistryEventTarget.cs | 54 +- ...stryImageDeletedEventData.Serialization.cs | 140 +- .../ContainerRegistryImageDeletedEventData.cs | 14 +- ...istryImagePushedEventData.Serialization.cs | 140 +- .../ContainerRegistryImagePushedEventData.cs | 14 +- ...sterSupportEndedEventData.Serialization.cs | 98 +- ...inerServiceClusterSupportEndedEventData.cs | 11 +- ...terSupportEndingEventData.Serialization.cs | 98 +- ...nerServiceClusterSupportEndingEventData.cs | 11 +- ...ceClusterSupportEventData.Serialization.cs | 106 +- ...ContainerServiceClusterSupportEventData.cs | 47 +- ...VersionAvailableEventData.Serialization.cs | 118 +- ...eNewKubernetesVersionAvailableEventData.cs | 52 +- ...eNodePoolRollingEventData.Serialization.cs | 106 +- ...ontainerServiceNodePoolRollingEventData.cs | 47 +- ...oolRollingFailedEventData.Serialization.cs | 98 +- ...erServiceNodePoolRollingFailedEventData.cs | 11 +- ...olRollingStartedEventData.Serialization.cs | 98 +- ...rServiceNodePoolRollingStartedEventData.cs | 11 +- ...RollingSucceededEventData.Serialization.cs | 98 +- ...erviceNodePoolRollingSucceededEventData.cs | 11 +- ...BoxCopyCompletedEventData.Serialization.cs | 118 +- .../DataBoxCopyCompletedEventData.cs | 49 +- ...taBoxCopyStartedEventData.Serialization.cs | 118 +- .../Generated/DataBoxCopyStartedEventData.cs | 49 +- ...oxOrderCompletedEventData.Serialization.cs | 118 +- .../DataBoxOrderCompletedEventData.cs | 49 +- .../src/Generated/DataBoxStageName.cs | 41 +- ...eConnectionStateEventInfo.Serialization.cs | 92 +- .../DeviceConnectionStateEventInfo.cs | 47 +- ...ctionStateEventProperties.Serialization.cs | 104 +- .../DeviceConnectionStateEventProperties.cs | 52 +- ...eLifeCycleEventProperties.Serialization.cs | 100 +- .../DeviceLifeCycleEventProperties.cs | 51 +- ...eTelemetryEventProperties.Serialization.cs | 132 +- .../DeviceTelemetryEventProperties.cs | 55 +- .../Generated/DeviceTwinInfo.Serialization.cs | 136 +- .../src/Generated/DeviceTwinInfo.cs | 65 +- .../DeviceTwinInfoProperties.Serialization.cs | 96 +- .../src/Generated/DeviceTwinInfoProperties.cs | 49 +- ...iceTwinInfoX509Thumbprint.Serialization.cs | 96 +- .../Generated/DeviceTwinInfoX509Thumbprint.cs | 49 +- .../DeviceTwinMetadata.Serialization.cs | 92 +- .../src/Generated/DeviceTwinMetadata.cs | 47 +- .../DeviceTwinProperties.Serialization.cs | 98 +- .../src/Generated/DeviceTwinProperties.cs | 48 +- ...VersionPublishedEventData.Serialization.cs | 130 +- .../EdgeSolutionVersionPublishedEventData.cs | 59 +- .../src/Generated/EventGridModelFactory.cs | 2039 +++++++++-------- ...CreatedOrUpdatedEventData.Serialization.cs | 168 +- ...GridMqttClientCreatedOrUpdatedEventData.cs | 21 +- ...qttClientDeletedEventData.Serialization.cs | 106 +- .../EventGridMqttClientDeletedEventData.cs | 12 +- .../EventGridMqttClientDisconnectionReason.cs | 64 +- ...ntGridMqttClientEventData.Serialization.cs | 114 +- .../Generated/EventGridMqttClientEventData.cs | 50 +- ...SessionConnectedEventData.Serialization.cs | 126 +- ...GridMqttClientSessionConnectedEventData.cs | 15 +- ...sionDisconnectedEventData.Serialization.cs | 140 +- ...dMqttClientSessionDisconnectedEventData.cs | 16 +- .../src/Generated/EventGridMqttClientState.cs | 37 +- ...ptureFileCreatedEventData.Serialization.cs | 154 +- .../EventHubCaptureFileCreatedEventData.cs | 57 +- ...icomImageCreatedEventData.Serialization.cs | 128 +- .../HealthcareDicomImageCreatedEventData.cs | 56 +- ...icomImageDeletedEventData.Serialization.cs | 128 +- .../HealthcareDicomImageDeletedEventData.cs | 56 +- ...icomImageUpdatedEventData.Serialization.cs | 128 +- .../HealthcareDicomImageUpdatedEventData.cs | 56 +- ...rResourceCreatedEventData.Serialization.cs | 130 +- .../HealthcareFhirResourceCreatedEventData.cs | 51 +- ...rResourceDeletedEventData.Serialization.cs | 130 +- .../HealthcareFhirResourceDeletedEventData.cs | 51 +- .../Generated/HealthcareFhirResourceType.cs | 363 ++- ...rResourceUpdatedEventData.Serialization.cs | 130 +- .../HealthcareFhirResourceUpdatedEventData.cs | 51 +- .../src/Generated/Internal/Argument.cs | 75 +- .../Internal/ChangeTrackingDictionary.cs | 24 +- .../Generated/Internal/ChangeTrackingList.cs | 17 +- .../Internal/CodeGenMemberAttribute.cs | 20 + .../Internal/CodeGenSerializationAttribute.cs | 48 + .../Internal/CodeGenSuppressAttribute.cs | 29 + .../Internal/CodeGenTypeAttribute.cs | 24 + .../Internal/ModelSerializationExtensions.cs | 173 +- .../src/Generated/Internal/Optional.cs | 12 +- .../src/Generated/Internal/TypeFormatters.cs | 152 ++ .../Internal/Utf8JsonRequestContent.cs | 55 - ...bDeviceConnectedEventData.Serialization.cs | 110 +- .../IotHubDeviceConnectedEventData.cs | 13 +- ...HubDeviceCreatedEventData.Serialization.cs | 106 +- .../Generated/IotHubDeviceCreatedEventData.cs | 13 +- ...HubDeviceDeletedEventData.Serialization.cs | 106 +- .../Generated/IotHubDeviceDeletedEventData.cs | 13 +- ...viceDisconnectedEventData.Serialization.cs | 110 +- .../IotHubDeviceDisconnectedEventData.cs | 13 +- ...bDeviceTelemetryEventData.Serialization.cs | 128 +- .../IotHubDeviceTelemetryEventData.cs | 15 +- ...essPolicyChangedEventData.Serialization.cs | 134 +- .../KeyVaultAccessPolicyChangedEventData.cs | 57 +- ...rtificateExpiredEventData.Serialization.cs | 134 +- .../KeyVaultCertificateExpiredEventData.cs | 57 +- ...ficateNearExpiryEventData.Serialization.cs | 134 +- .../KeyVaultCertificateNearExpiryEventData.cs | 57 +- ...ewVersionCreatedEventData.Serialization.cs | 134 +- ...ltCertificateNewVersionCreatedEventData.cs | 57 +- ...yVaultKeyExpiredEventData.Serialization.cs | 134 +- .../Generated/KeyVaultKeyExpiredEventData.cs | 57 +- ...ultKeyNearExpiryEventData.Serialization.cs | 134 +- .../KeyVaultKeyNearExpiryEventData.cs | 57 +- ...ewVersionCreatedEventData.Serialization.cs | 134 +- .../KeyVaultKeyNewVersionCreatedEventData.cs | 57 +- ...ultSecretExpiredEventData.Serialization.cs | 134 +- .../KeyVaultSecretExpiredEventData.cs | 57 +- ...SecretNearExpiryEventData.Serialization.cs | 134 +- .../KeyVaultSecretNearExpiryEventData.cs | 57 +- ...ewVersionCreatedEventData.Serialization.cs | 134 +- ...eyVaultSecretNewVersionCreatedEventData.cs | 57 +- ...setDriftDetectedEventData.Serialization.cs | 162 +- ...ngServicesDatasetDriftDetectedEventData.cs | 58 +- ...cesModelDeployedEventData.Serialization.cs | 126 +- ...eLearningServicesModelDeployedEventData.cs | 51 +- ...sModelRegisteredEventData.Serialization.cs | 122 +- ...earningServicesModelRegisteredEventData.cs | 49 +- ...icesRunCompletedEventData.Serialization.cs | 130 +- ...neLearningServicesRunCompletedEventData.cs | 53 +- ...RunStatusChangedEventData.Serialization.cs | 134 +- ...arningServicesRunStatusChangedEventData.cs | 55 +- ...sGeofenceEnteredEventData.Serialization.cs | 127 +- .../Generated/MapsGeofenceEnteredEventData.cs | 4 +- ...psGeofenceEventProperties.Serialization.cs | 137 +- .../Generated/MapsGeofenceEventProperties.cs | 42 +- ...psGeofenceExitedEventData.Serialization.cs | 127 +- .../Generated/MapsGeofenceExitedEventData.cs | 4 +- .../MapsGeofenceGeometry.Serialization.cs | 118 +- .../src/Generated/MapsGeofenceGeometry.cs | 53 +- ...psGeofenceResultEventData.Serialization.cs | 127 +- .../Generated/MapsGeofenceResultEventData.cs | 4 +- ...GridSystemEventsClientBuilderExtensions.cs | 14 - ...tTeamsUserIdentifierModel.Serialization.cs | 104 +- .../MicrosoftTeamsUserIdentifierModel.cs | 49 +- ...reMessagingEventGridSystemEventsContext.cs | 400 ++-- ...honeNumberIdentifierModel.Serialization.cs | 92 +- .../Generated/PhoneNumberIdentifierModel.cs | 47 +- ...licyStateChangedEventData.Serialization.cs | 132 +- ...licyInsightsPolicyStateChangedEventData.cs | 58 +- ...licyStateCreatedEventData.Serialization.cs | 132 +- ...licyInsightsPolicyStateCreatedEventData.cs | 58 +- ...licyStateDeletedEventData.Serialization.cs | 132 +- ...licyInsightsPolicyStateDeletedEventData.cs | 58 +- ...portRdbCompletedEventData.Serialization.cs | 113 +- .../RedisExportRdbCompletedEventData.cs | 41 +- ...portRdbCompletedEventData.Serialization.cs | 113 +- .../RedisImportRdbCompletedEventData.cs | 41 +- ...atchingCompletedEventData.Serialization.cs | 113 +- .../RedisPatchingCompletedEventData.cs | 41 +- ...ScalingCompletedEventData.Serialization.cs | 113 +- .../RedisScalingCompletedEventData.cs | 41 +- ...urceActionCancelEventData.Serialization.cs | 158 +- .../ResourceActionCancelEventData.cs | 63 +- ...rceActionFailureEventData.Serialization.cs | 158 +- .../ResourceActionFailureEventData.cs | 63 +- ...rceActionSuccessEventData.Serialization.cs | 158 +- .../ResourceActionSuccessEventData.cs | 63 +- .../ResourceAuthorization.Serialization.cs | 116 +- .../src/Generated/ResourceAuthorization.cs | 53 +- ...urceDeleteCancelEventData.Serialization.cs | 158 +- .../ResourceDeleteCancelEventData.cs | 63 +- ...rceDeleteFailureEventData.Serialization.cs | 158 +- .../ResourceDeleteFailureEventData.cs | 63 +- ...rceDeleteSuccessEventData.Serialization.cs | 158 +- .../ResourceDeleteSuccessEventData.cs | 63 +- .../ResourceHttpRequest.Serialization.cs | 103 +- .../src/Generated/ResourceHttpRequest.cs | 43 +- ...sourcesScheduledEventData.Serialization.cs | 110 +- ...ServiceEventResourcesScheduledEventData.cs | 13 +- ...sourcesAnnotatedEventData.Serialization.cs | 113 +- ...ationsHealthResourcesAnnotatedEventData.cs | 13 +- ...ityStatusChangedEventData.Serialization.cs | 114 +- ...urcesAvailabilityStatusChangedEventData.cs | 13 +- ...cationsOperationalDetails.Serialization.cs | 91 +- ...ResourceNotificationsOperationalDetails.cs | 39 +- ...onsResourceDeletedDetails.Serialization.cs | 108 +- ...urceNotificationsResourceDeletedDetails.cs | 67 +- ...sResourceDeletedEventData.Serialization.cs | 117 +- ...ceNotificationsResourceDeletedEventData.cs | 49 +- ...CreatedOrUpdatedEventData.Serialization.cs | 113 +- ...urceManagementCreatedOrUpdatedEventData.cs | 13 +- ...anagementDeletedEventData.Serialization.cs | 109 +- ...tionsResourceManagementDeletedEventData.cs | 12 +- ...onsResourceUpdatedDetails.Serialization.cs | 149 +- ...urceNotificationsResourceUpdatedDetails.cs | 51 +- ...sResourceUpdatedEventData.Serialization.cs | 118 +- ...ceNotificationsResourceUpdatedEventData.cs | 51 +- ...ourceWriteCancelEventData.Serialization.cs | 158 +- .../Generated/ResourceWriteCancelEventData.cs | 63 +- ...urceWriteFailureEventData.Serialization.cs | 158 +- .../ResourceWriteFailureEventData.cs | 63 +- ...urceWriteSuccessEventData.Serialization.cs | 158 +- .../ResourceWriteSuccessEventData.cs | 63 +- ...dicNotificationsEventData.Serialization.cs | 144 +- ...AvailablePeriodicNotificationsEventData.cs | 54 +- ...eWithNoListenersEventData.Serialization.cs | 144 +- ...ssagesAvailableWithNoListenersEventData.cs | 54 +- ...dicNotificationsEventData.Serialization.cs | 144 +- ...AvailablePeriodicNotificationsEventData.cs | 54 +- ...eWithNoListenersEventData.Serialization.cs | 144 +- ...ssagesAvailableWithNoListenersEventData.cs | 54 +- ...nectionConnectedEventData.Serialization.cs | 120 +- ...rviceClientConnectionConnectedEventData.cs | 51 +- ...tionDisconnectedEventData.Serialization.cs | 124 +- ...ceClientConnectionDisconnectedEventData.cs | 52 +- .../src/Generated/StampKind.cs | 41 +- ...erationInitiatedEventData.Serialization.cs | 144 +- ...StorageAsyncOperationInitiatedEventData.cs | 55 +- .../src/Generated/StorageBlobAccessTier.cs | 49 +- ...orageBlobCreatedEventData.Serialization.cs | 158 +- .../Generated/StorageBlobCreatedEventData.cs | 58 +- ...orageBlobDeletedEventData.Serialization.cs | 138 +- .../Generated/StorageBlobDeletedEventData.cs | 54 +- ...yPolicyCompletedEventData.Serialization.cs | 129 +- ...geBlobInventoryPolicyCompletedEventData.cs | 45 +- ...orageBlobRenamedEventData.Serialization.cs | 134 +- .../Generated/StorageBlobRenamedEventData.cs | 53 +- ...eBlobTierChangedEventData.Serialization.cs | 152 +- .../StorageBlobTierChangedEventData.cs | 57 +- ...DirectoryCreatedEventData.Serialization.cs | 134 +- .../StorageDirectoryCreatedEventData.cs | 53 +- ...DirectoryDeletedEventData.Serialization.cs | 138 +- .../StorageDirectoryDeletedEventData.cs | 54 +- ...DirectoryRenamedEventData.Serialization.cs | 134 +- .../StorageDirectoryRenamedEventData.cs | 53 +- .../StorageLifecycleCompletionStatus.cs | 41 +- ...PolicyActionSummaryDetail.Serialization.cs | 101 +- ...orageLifecyclePolicyActionSummaryDetail.cs | 41 +- ...ePolicyCompletedEventData.Serialization.cs | 126 +- ...torageLifecyclePolicyCompletedEventData.cs | 56 +- ...LifecyclePolicyRunSummary.Serialization.cs | 92 +- .../StorageLifecyclePolicyRunSummary.cs | 44 +- ...ignmentCompletedEventData.Serialization.cs | 134 +- ...StorageTaskAssignmentCompletedEventData.cs | 51 +- .../StorageTaskAssignmentCompletedStatus.cs | 37 +- ...AssignmentQueuedEventData.Serialization.cs | 111 +- .../StorageTaskAssignmentQueuedEventData.cs | 40 +- ...ageTaskCompletedEventData.Serialization.cs | 130 +- .../StorageTaskCompletedEventData.cs | 51 +- .../Generated/StorageTaskCompletedStatus.cs | 37 +- ...torageTaskQueuedEventData.Serialization.cs | 109 +- .../Generated/StorageTaskQueuedEventData.cs | 40 +- ...scriptionDeletedEventData.Serialization.cs | 109 +- .../Generated/SubscriptionDeletedEventData.cs | 47 +- ...iptionValidationEventData.Serialization.cs | 110 +- .../SubscriptionValidationEventData.cs | 49 +- ...riptionValidationResponse.Serialization.cs | 108 +- .../SubscriptionValidationResponse.cs | 42 +- ...rvicePlanUpdatedEventData.Serialization.cs | 135 +- .../WebAppServicePlanUpdatedEventData.cs | 46 +- ...cePlanUpdatedEventDataSku.Serialization.cs | 105 +- .../WebAppServicePlanUpdatedEventDataSku.cs | 43 +- .../WebAppUpdatedEventData.Serialization.cs | 129 +- .../src/Generated/WebAppUpdatedEventData.cs | 45 +- ...erationCompletedEventData.Serialization.cs | 129 +- .../WebBackupOperationCompletedEventData.cs | 45 +- ...pOperationFailedEventData.Serialization.cs | 129 +- .../WebBackupOperationFailedEventData.cs | 45 +- ...OperationStartedEventData.Serialization.cs | 129 +- .../WebBackupOperationStartedEventData.cs | 45 +- ...erationCompletedEventData.Serialization.cs | 129 +- .../WebRestoreOperationCompletedEventData.cs | 45 +- ...eOperationFailedEventData.Serialization.cs | 129 +- .../WebRestoreOperationFailedEventData.cs | 45 +- ...OperationStartedEventData.Serialization.cs | 129 +- .../WebRestoreOperationStartedEventData.cs | 45 +- ...lotSwapCompletedEventData.Serialization.cs | 129 +- .../WebSlotSwapCompletedEventData.cs | 45 +- ...ebSlotSwapFailedEventData.Serialization.cs | 129 +- .../Generated/WebSlotSwapFailedEventData.cs | 45 +- ...bSlotSwapStartedEventData.Serialization.cs | 129 +- .../Generated/WebSlotSwapStartedEventData.cs | 45 +- ...PreviewCancelledEventData.Serialization.cs | 129 +- ...ebSlotSwapWithPreviewCancelledEventData.cs | 45 +- ...thPreviewStartedEventData.Serialization.cs | 129 +- .../WebSlotSwapWithPreviewStartedEventData.cs | 45 +- .../tsp-location.yaml | 3 +- 653 files changed, 24560 insertions(+), 28190 deletions(-) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/TypeFormatters.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Utf8JsonRequestContent.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MessagingEventGridSystemEventsClientBuilderExtensions.cs diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md index 37e6360fb5c6..668b8755245b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + +### Features Added + +### Bug Fixes + +### Other Changes + ## 1.0.0 (2025-06-23) ### Features Added diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Azure.Messaging.EventGrid.SystemEvents.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Azure.Messaging.EventGrid.SystemEvents.csproj index 90a38675cd66..1bc30a318981 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Azure.Messaging.EventGrid.SystemEvents.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Azure.Messaging.EventGrid.SystemEvents.csproj @@ -3,10 +3,12 @@ Azure Event Grid is a publish-subscribe service that allows cloud events to be passed from producers to consumers. This library contains the system event models used by Azure Event Grid. For more information about Event Grid, see https://azure.microsoft.com/services/event-grid. Azure EventGrid System Events client library - 1.0.0 + 1.1.0-beta.1 + 1.0.0 Azure;Event Grid;CloudEvent;$(PackageCommonTags) $(RequiredTargetFrameworks) true + false true $(NoWarn); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCallEndedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCallEndedEventData.cs index 2f740d099cd4..1f26f0e15463 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCallEndedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCallEndedEventData.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedEventData.cs index 96680380f0e7..9f4a39a3c86a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedEventData.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; namespace Azure.Messaging.EventGrid.SystemEvents diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedWithUserEventData.cs index d2e850dfe184..2bd6682bb2e9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadCreatedWithUserEventData.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; namespace Azure.Messaging.EventGrid.SystemEvents diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedEventData.cs index 36e6b6404067..b893dcd3d6d4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedEventData.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; namespace Azure.Messaging.EventGrid.SystemEvents diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedPerUserEventData.cs index 5ddc6c5935d0..05c7262ab457 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; namespace Azure.Messaging.EventGrid.SystemEvents diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCommunicationIdentifierKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCommunicationIdentifierKind.cs index 9611a741552f..9719b3f10998 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCommunicationIdentifierKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsCommunicationIdentifierKind.cs @@ -6,7 +6,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// The identifier kind, for example 'communicationUser' or 'phoneNumber'. - [CodeGenModel("CommunicationIdentifierModelKind")] + [CodeGenType("CommunicationIdentifierModelKind")] public readonly partial struct AcsCommunicationIdentifierKind { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMessageEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMessageEventData.cs index 830e9a6770c8..0846a15b132b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMessageEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMessageEventData.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core; -using Azure.Messaging.EventGrid.SystemEvents; - namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of common properties of all chat thread events. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMicrosoftTeamsAppIdentifier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMicrosoftTeamsAppIdentifier.cs index d8018d2e2b69..623dffc65306 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMicrosoftTeamsAppIdentifier.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsMicrosoftTeamsAppIdentifier.cs @@ -1,12 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core; - namespace Azure.Messaging.EventGrid.SystemEvents { /// A Microsoft Teams application. - [CodeGenModel("MicrosoftTeamsAppIdentifierModel")] + [CodeGenType("MicrosoftTeamsAppIdentifierModel")] public partial class AcsMicrosoftTeamsAppIdentifier { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobClassificationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobClassificationFailedEventData.cs index 2b3b041b92b8..ccf8f6db708c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobClassificationFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobClassificationFailedEventData.cs @@ -2,9 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; -using System.Linq; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { @@ -38,4 +36,4 @@ public IReadOnlyList Errors private List _errors; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobEventData.cs new file mode 100644 index 000000000000..070f9e6c0c3c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobEventData.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class AcsRouterJobEventData + { + /// Router Job events Labels. + public IReadOnlyDictionary Labels { get; } + + /// Router Jobs events Tags. + public IReadOnlyDictionary Tags { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobReceivedEventData.cs index 32d07af13372..c793e8e42e13 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AcsRouterJobReceivedEventData.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Collections.Generic; using System.ComponentModel; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ApiManagementGatewayTokenNearExpiryProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ApiManagementGatewayTokenNearExpiryProperties.cs index 827f90280178..cfc2de7a559d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ApiManagementGatewayTokenNearExpiryProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ApiManagementGatewayTokenNearExpiryProperties.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core; - namespace Azure.Messaging.EventGrid.SystemEvents { - [CodeGenModel("ApiManagementNearExpiryGatewayTokenProperties")] + [CodeGenType("ApiManagementNearExpiryGatewayTokenProperties")] public partial class ApiManagementGatewayTokenNearExpiryProperties { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppAction.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppAction.cs index 3be6169416c0..0f3ce6ed43e7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppAction.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppAction.cs @@ -9,7 +9,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Type of action of the operation. - [CodeGenModel("AppAction")] + [CodeGenType("AppAction")] public readonly partial struct AppAction { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppConfigurationSnapshotEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppConfigurationSnapshotEventData.cs index ae2cb4819227..40adddc27430 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppConfigurationSnapshotEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppConfigurationSnapshotEventData.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core; - namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of common properties of snapshot events. @@ -12,4 +10,4 @@ public partial class AppConfigurationSnapshotEventData [CodeGenMember("Etag")] public string ETag { get; } } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppServicePlanAction.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppServicePlanAction.cs index 56ed36323fa3..119b60fe7dd2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppServicePlanAction.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/AppServicePlanAction.cs @@ -1,15 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.Collections.Generic; -using System.Text; -using Azure.Core; - namespace Azure.Messaging.EventGrid.SystemEvents { /// Type of action on the app service plan. - [CodeGenModel("AppServicePlanAction")] + [CodeGenType("AppServicePlanAction")] public readonly partial struct AppServicePlanAction { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs index b5cfca043749..bba6d316d04f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs @@ -15,7 +15,16 @@ namespace Azure.Messaging.EventGrid { #pragma warning disable CA1054 // URI-like parameters should not be strings - [CodeGenType("MessagingEventGridSystemEventsModelFactory")] + [CodeGenType("EventGridSystemEventsModelFactory")] + [CodeGenSuppress("ResourceWriteSuccessEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceWriteFailureEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceWriteCancelEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceDeleteSuccessEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceDeleteFailureEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceDeleteCancelEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceActionSuccessEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceActionFailureEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("ResourceActionCancelEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] public static partial class EventGridModelFactory { /// Initializes new instance of MediaJobError class. @@ -530,7 +539,7 @@ public static MapsGeofenceEventProperties MapsGeofenceEventProperties(IReadOnlyL [EditorBrowsable(EditorBrowsableState.Never)] public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyList participants) { - return AcsChatThreadCreatedWithUserEventData(recipientCommunicationIdentifier, transactionId, threadId, createTime, version, createdByCommunicationIdentifier, properties, new Dictionary(), participants); + return AcsChatThreadCreatedWithUserEventData(recipientCommunicationIdentifier, transactionId, threadId, createTime, version, createdByCommunicationIdentifier, properties, participants); } /// Initializes new instance of AcsChatThreadCreatedEventData class. @@ -1113,7 +1122,7 @@ public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngageme /// Unavailable For Matching for Router Job Received. /// A new instance for mocking. [EditorBrowsable(EditorBrowsableState.Never)] - public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.Models.AcsRouterJobStatus? jobStatus = null, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) + public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus? jobStatus = null, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) { labels ??= new Dictionary(); tags ??= new Dictionary(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridMqttClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridMqttClientDisconnectionReason.cs index aa921c0dd671..3fc0808e3f17 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridMqttClientDisconnectionReason.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridMqttClientDisconnectionReason.cs @@ -12,6 +12,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The client's IP address is blocked by IP filter or Private links configuration. [CodeGenMember("IpForbidden")] public static EventGridMqttClientDisconnectionReason IPForbidden { get; } = - new EventGridMqttClientDisconnectionReason(IPForbiddenValue); + new EventGridMqttClientDisconnectionReason(IpForbiddenValue); } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionCancelEventData.cs index df7cfc40862e..7646c8778596 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionCancelEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceActionCancelEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceActionCancelEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionFailureEventData.cs index 47f4bcbfb39b..12a17ed5373f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionFailureEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceActionFailureEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceActionFailureEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionSuccessEventData.cs index 34ee5bc3760c..365a30602acd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceActionSuccessEventData.cs @@ -20,7 +20,7 @@ public partial class ResourceActionSuccessEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -44,7 +44,7 @@ public partial class ResourceActionSuccessEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteCancelEventData.cs index e775e30d3be9..6f4a96d6919a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteCancelEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceDeleteCancelEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceDeleteCancelEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteFailureEventData.cs index 7adabf8913f0..96f89b5da657 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteFailureEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceDeleteFailureEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceDeleteFailureEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteSuccessEventData.cs index 3b630dc5d102..cc2b0e4faf96 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceDeleteSuccessEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceDeleteSuccessEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceDeleteSuccessEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteCancelEventData.cs index 3488637a8f18..882f27dbdf63 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteCancelEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceWriteCancelEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceWriteCancelEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } -} \ No newline at end of file +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteFailureEventData.cs index af3fc879fd6a..b430f87a91ec 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteFailureEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceWriteFailureEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceWriteFailureEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteSuccessEventData.cs index 30c931ab6bc2..2de80ef06f39 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/ResourceWriteSuccessEventData.cs @@ -19,7 +19,7 @@ public partial class ResourceWriteSuccessEventData private string _authorization; /// The requested authorization for the operation. - public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson); + public ResourceAuthorization AuthorizationValue => _authorizationValue ??= ResourceAuthorization.DeserializeResourceAuthorization(AuthorizationJson, ModelSerializationExtensions.WireOptions); private ResourceAuthorization _authorizationValue; [CodeGenMember("Claims")] @@ -43,7 +43,7 @@ public partial class ResourceWriteSuccessEventData private string _httpRequest; /// The details of the operation. - public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson); + public ResourceHttpRequest HttpRequestValue => _httpRequestValue ??= ResourceHttpRequest.DeserializeResourceHttpRequest(HttpRequestJson, ModelSerializationExtensions.WireOptions); private ResourceHttpRequest _httpRequestValue; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/StampKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/StampKind.cs index 3c5e8b868c84..0f26a7df5452 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/StampKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/StampKind.cs @@ -9,7 +9,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Kind of environment where app service plan is. - [CodeGenModel("StampKind")] + [CodeGenType("StampKind")] public readonly partial struct StampKind { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/UnknownMediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/UnknownMediaJobOutput.Serialization.cs index f941875e032b..217c29e06821 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/UnknownMediaJobOutput.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/UnknownMediaJobOutput.Serialization.cs @@ -1,10 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// - -#nullable disable - using System.Text.Json; using Azure.Messaging.EventGrid.SystemEvents; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.Serialization.cs index a3d90e809d06..ba46e8a97da0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsCallEndReasonProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of calling event reason properties. + public partial class AcsCallEndReasonProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallEndReasonProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("phrase"u8); writer.WriteStringValue(Phrase); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsCallEndReasonProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallEndReasonProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsCallEndReasonProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallEndReasonProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallEndReasonProperties(document.RootElement, options); } - internal static AcsCallEndReasonProperties DeserializeAcsCallEndReasonProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallEndReasonProperties DeserializeAcsCallEndReasonProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,46 +93,47 @@ internal static AcsCallEndReasonProperties DeserializeAcsCallEndReasonProperties int? code = default; int? subCode = default; string phrase = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - code = property.Value.GetInt32(); + code = prop.Value.GetInt32(); continue; } - if (property.NameEquals("subCode"u8)) + if (prop.NameEquals("subCode"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - subCode = property.Value.GetInt32(); + subCode = prop.Value.GetInt32(); continue; } - if (property.NameEquals("phrase"u8)) + if (prop.NameEquals("phrase"u8)) { - phrase = property.Value.GetString(); + phrase = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsCallEndReasonProperties(code, subCode, phrase, serializedAdditionalRawData); + return new AcsCallEndReasonProperties(code, subCode, phrase, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - AcsCallEndReasonProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallEndReasonProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsCallEndReasonProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallEndReasonProperties(document.RootElement, options); } default: @@ -154,22 +164,7 @@ AcsCallEndReasonProperties IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsCallEndReasonProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallEndReasonProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.cs index b0c87d904258..2bbbb7fa0b91 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndReasonProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of calling event reason properties. public partial class AcsCallEndReasonProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsCallEndReasonProperties() @@ -54,19 +25,21 @@ internal AcsCallEndReasonProperties() /// Reason code for ending the call. /// Reason subcode for ending the call. /// Reason for the ending the call. - /// Keeps track of any properties unknown to the library. - internal AcsCallEndReasonProperties(int? code, int? subCode, string phrase, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsCallEndReasonProperties(int? code, int? subCode, string phrase, IDictionary additionalBinaryDataProperties) { Code = code; SubCode = subCode; Phrase = phrase; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Reason code for ending the call. public int? Code { get; } + /// Reason subcode for ending the call. public int? SubCode { get; } + /// Reason for the ending the call. public string Phrase { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByKind.cs index 9ddeb05d3059..69d81117db27 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByKind.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsCallEndedByKind : IEquatable { private readonly string _value; + /// Participant. + private const string ParticipantValue = "Participant"; + /// MicrosoftInternal. + private const string MicrosoftInternalValue = "MicrosoftInternal"; /// Initializes a new instance of . + /// The value. /// is null. public AcsCallEndedByKind(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ParticipantValue = "Participant"; - private const string MicrosoftInternalValue = "MicrosoftInternal"; + _value = value; + } /// Participant. public static AcsCallEndedByKind Participant { get; } = new AcsCallEndedByKind(ParticipantValue); + /// MicrosoftInternal. public static AcsCallEndedByKind MicrosoftInternal { get; } = new AcsCallEndedByKind(MicrosoftInternalValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsCallEndedByKind left, AcsCallEndedByKind right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsCallEndedByKind left, AcsCallEndedByKind right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsCallEndedByKind(string value) => new AcsCallEndedByKind(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsCallEndedByKind?(string value) => value == null ? null : new AcsCallEndedByKind(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsCallEndedByKind other && Equals(other); - /// + + /// public bool Equals(AcsCallEndedByKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.Serialization.cs index 2520d60cf29f..a76325ed1f7f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsCallEndedByProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of calling event ended by properties. + public partial class AcsCallEndedByProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallEndedByProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallEndedByProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("communicationIdentifier"u8); writer.WriteObjectValue(CommunicationIdentifier, options); if (Optional.IsDefined(Kind)) @@ -43,15 +47,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -60,65 +64,71 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsCallEndedByProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallEndedByProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsCallEndedByProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallEndedByProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallEndedByProperties(document.RootElement, options); } - internal static AcsCallEndedByProperties DeserializeAcsCallEndedByProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallEndedByProperties DeserializeAcsCallEndedByProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } CommunicationIdentifierModel communicationIdentifier = default; - AcsCallEndedByKind? type = default; + AcsCallEndedByKind? kind = default; string name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("communicationIdentifier"u8)) + if (prop.NameEquals("communicationIdentifier"u8)) { - communicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + communicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - type = new AcsCallEndedByKind(property.Value.GetString()); + kind = new AcsCallEndedByKind(prop.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsCallEndedByProperties(communicationIdentifier, type, name, serializedAdditionalRawData); + return new AcsCallEndedByProperties(communicationIdentifier, kind, name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -128,15 +138,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - AcsCallEndedByProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallEndedByProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsCallEndedByProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallEndedByProperties(document.RootElement, options); } default: @@ -144,22 +159,7 @@ AcsCallEndedByProperties IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsCallEndedByProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallEndedByProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.cs index 25716c376d07..532438a4f803 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedByProperties.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of calling event ended by properties. public partial class AcsCallEndedByProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The communication identifier of the call ended by. /// The name of the call ended by. - /// or is null. internal AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier, string name) { - Argument.AssertNotNull(communicationIdentifier, nameof(communicationIdentifier)); - Argument.AssertNotNull(name, nameof(name)); - CommunicationIdentifier = communicationIdentifier; Name = name; } @@ -62,24 +29,21 @@ internal AcsCallEndedByProperties(CommunicationIdentifierModel communicationIden /// The communication identifier of the call ended by. /// The type of call ended by. /// The name of the call ended by. - /// Keeps track of any properties unknown to the library. - internal AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier, AcsCallEndedByKind? kind, string name, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier, AcsCallEndedByKind? kind, string name, IDictionary additionalBinaryDataProperties) { CommunicationIdentifier = communicationIdentifier; Kind = kind; Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsCallEndedByProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The communication identifier of the call ended by. public CommunicationIdentifierModel CommunicationIdentifier { get; } + /// The type of call ended by. public AcsCallEndedByKind? Kind { get; } + /// The name of the call ended by. public string Name { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.Serialization.cs index 0e76a1a7366c..d40b90e5599b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallEnded event. [JsonConverter(typeof(AcsCallEndedEventDataConverter))] - public partial class AcsCallEndedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsCallEndedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallEndedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallEndedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(EndedBy)) { @@ -54,142 +58,148 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsCallEndedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallEndedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsCallEndedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallEndedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallEndedEventData(document.RootElement, options); } - internal static AcsCallEndedEventData DeserializeAcsCallEndedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallEndedEventData DeserializeAcsCallEndedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - AcsCallEndedByProperties endedBy = default; - AcsCallEndReasonProperties reason = default; - TimeSpan? callDurationInSeconds = default; AcsCallParticipantProperties startedBy = default; string serverCallId = default; - AcsCallGroupProperties group = default; + AcsCallGroupProperties @group = default; AcsCallRoomProperties room = default; bool? isTwoParty = default; string correlationId = default; bool? isRoomsCall = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + AcsCallEndedByProperties endedBy = default; + AcsCallEndReasonProperties reason = default; + TimeSpan? callDuration = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("endedBy"u8)) + if (prop.NameEquals("startedBy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endedBy = AcsCallEndedByProperties.DeserializeAcsCallEndedByProperties(property.Value, options); + startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); + continue; + } + if (prop.NameEquals("serverCallId"u8)) + { + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("reason"u8)) + if (prop.NameEquals("group"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - reason = AcsCallEndReasonProperties.DeserializeAcsCallEndReasonProperties(property.Value, options); + @group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(prop.Value, options); continue; } - if (property.NameEquals("callDurationInSeconds"u8)) + if (prop.NameEquals("room"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - callDurationInSeconds = TimeSpan.FromSeconds(property.Value.GetDouble()); + room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(prop.Value, options); continue; } - if (property.NameEquals("startedBy"u8)) + if (prop.NameEquals("isTwoParty"u8)) { - startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isTwoParty = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("correlationId"u8)) { - serverCallId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("group"u8)) + if (prop.NameEquals("isRoomsCall"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(property.Value, options); + isRoomsCall = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("room"u8)) + if (prop.NameEquals("endedBy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(property.Value, options); + endedBy = AcsCallEndedByProperties.DeserializeAcsCallEndedByProperties(prop.Value, options); continue; } - if (property.NameEquals("isTwoParty"u8)) + if (prop.NameEquals("reason"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isTwoParty = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); + reason = AcsCallEndReasonProperties.DeserializeAcsCallEndReasonProperties(prop.Value, options); continue; } - if (property.NameEquals("isRoomsCall"u8)) + if (prop.NameEquals("callDurationInSeconds"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isRoomsCall = property.Value.GetBoolean(); + callDuration = TimeSpan.FromSeconds(prop.Value.GetDouble()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsCallEndedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData, + additionalBinaryDataProperties, endedBy, reason, - callDurationInSeconds); + callDuration); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -199,15 +209,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - AcsCallEndedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallEndedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsCallEndedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallEndedEventData(document.RootElement, options); } default: @@ -215,35 +230,28 @@ AcsCallEndedEventData IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsCallEndedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallEndedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsCallEndedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsCallEndedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsCallEndedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsCallEndedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsCallEndedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.cs index 35fb4a6c4b90..d7bccaea50e9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallEndedEventData.cs @@ -17,12 +17,8 @@ public partial class AcsCallEndedEventData : AcsCallingEventProperties /// The call participant who initiated the call. /// The call id of the server. /// The correlationId of calling event. - /// , or is null. internal AcsCallEndedEventData(AcsCallParticipantProperties startedBy, string serverCallId, string correlationId) : base(startedBy, serverCallId, correlationId) { - Argument.AssertNotNull(startedBy, nameof(startedBy)); - Argument.AssertNotNull(serverCallId, nameof(serverCallId)); - Argument.AssertNotNull(correlationId, nameof(correlationId)); } /// Initializes a new instance of . @@ -33,24 +29,20 @@ internal AcsCallEndedEventData(AcsCallParticipantProperties startedBy, string se /// Is two-party in calling event. /// The correlationId of calling event. /// Is the calling event a room call. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The communication identifier of the user who was disconnected. /// The reason for ending the call. - /// Duration of the call in seconds. - internal AcsCallEndedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary serializedAdditionalRawData, AcsCallEndedByProperties endedBy, AcsCallEndReasonProperties reason, TimeSpan? callDuration) : base(startedBy, serverCallId, group, room, isTwoParty, correlationId, isRoomsCall, serializedAdditionalRawData) + /// Duration of the call. + internal AcsCallEndedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties @group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary additionalBinaryDataProperties, AcsCallEndedByProperties endedBy, AcsCallEndReasonProperties reason, TimeSpan? callDuration) : base(startedBy, serverCallId, @group, room, isTwoParty, correlationId, isRoomsCall, additionalBinaryDataProperties) { EndedBy = endedBy; Reason = reason; CallDuration = callDuration; } - /// Initializes a new instance of for deserialization. - internal AcsCallEndedEventData() - { - } - /// The communication identifier of the user who was disconnected. public AcsCallEndedByProperties EndedBy { get; } + /// The reason for ending the call. public AcsCallEndReasonProperties Reason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.Serialization.cs index cccac49b1463..8063effbb88f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsCallGroupProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of calling event group properties. + public partial class AcsCallGroupProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallGroupProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,49 +55,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsCallGroupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallGroupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsCallGroupProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallGroupProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallGroupProperties(document.RootElement, options); } - internal static AcsCallGroupProperties DeserializeAcsCallGroupProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallGroupProperties DeserializeAcsCallGroupProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsCallGroupProperties(id, serializedAdditionalRawData); + return new AcsCallGroupProperties(id, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -108,15 +113,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - AcsCallGroupProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallGroupProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsCallGroupProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallGroupProperties(document.RootElement, options); } default: @@ -124,22 +134,7 @@ AcsCallGroupProperties IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsCallGroupProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallGroupProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.cs index 801407f9494f..c593d9ad027a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallGroupProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of calling event group properties. public partial class AcsCallGroupProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsCallGroupProperties() @@ -52,11 +23,11 @@ internal AcsCallGroupProperties() /// Initializes a new instance of . /// Group Id. - /// Keeps track of any properties unknown to the library. - internal AcsCallGroupProperties(string id, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsCallGroupProperties(string id, IDictionary additionalBinaryDataProperties) { Id = id; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Group Id. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.Serialization.cs index e303d47e73ce..d164c84f00f9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantAdded event. [JsonConverter(typeof(AcsCallParticipantAddedEventDataConverter))] - public partial class AcsCallParticipantAddedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsCallParticipantAddedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallParticipantAddedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,150 +35,155 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantAddedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AcsCallParticipantAddedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallParticipantAddedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsCallParticipantAddedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantAddedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallParticipantAddedEventData(document.RootElement, options); } - internal static AcsCallParticipantAddedEventData DeserializeAcsCallParticipantAddedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallParticipantAddedEventData DeserializeAcsCallParticipantAddedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - AcsCallParticipantProperties user = default; - string displayName = default; - string participantId = default; - string userAgent = default; AcsCallParticipantProperties startedBy = default; string serverCallId = default; - AcsCallGroupProperties group = default; + AcsCallGroupProperties @group = default; AcsCallRoomProperties room = default; bool? isTwoParty = default; string correlationId = default; bool? isRoomsCall = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + AcsCallParticipantProperties user = default; + string displayName = default; + string participantId = default; + string userAgent = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("user"u8)) + if (prop.NameEquals("startedBy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - user = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("displayName"u8)) + if (prop.NameEquals("serverCallId"u8)) { - displayName = property.Value.GetString(); + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantId"u8)) + if (prop.NameEquals("group"u8)) { - participantId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(prop.Value, options); continue; } - if (property.NameEquals("userAgent"u8)) + if (prop.NameEquals("room"u8)) { - userAgent = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(prop.Value, options); continue; } - if (property.NameEquals("startedBy"u8)) + if (prop.NameEquals("isTwoParty"u8)) { - startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isTwoParty = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("correlationId"u8)) { - serverCallId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("group"u8)) + if (prop.NameEquals("isRoomsCall"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(property.Value, options); + isRoomsCall = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("room"u8)) + if (prop.NameEquals("user"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(property.Value, options); + user = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("isTwoParty"u8)) + if (prop.NameEquals("displayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isTwoParty = property.Value.GetBoolean(); + displayName = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("participantId"u8)) { - correlationId = property.Value.GetString(); + participantId = prop.Value.GetString(); continue; } - if (property.NameEquals("isRoomsCall"u8)) + if (prop.NameEquals("userAgent"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isRoomsCall = property.Value.GetBoolean(); + userAgent = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsCallParticipantAddedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData, + additionalBinaryDataProperties, user, displayName, participantId, userAgent); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -183,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - AcsCallParticipantAddedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallParticipantAddedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsCallParticipantAddedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallParticipantAddedEventData(document.RootElement, options); } default: @@ -199,35 +214,28 @@ AcsCallParticipantAddedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsCallParticipantAddedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallParticipantAddedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsCallParticipantAddedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsCallParticipantAddedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsCallParticipantAddedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsCallParticipantAddedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsCallParticipantAddedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.cs index ae3655e36d3a..402fc49a99d0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantAddedEventData.cs @@ -17,12 +17,8 @@ public partial class AcsCallParticipantAddedEventData : AcsCallParticipantEventD /// The call participant who initiated the call. /// The call id of the server. /// The correlationId of calling event. - /// , or is null. internal AcsCallParticipantAddedEventData(AcsCallParticipantProperties startedBy, string serverCallId, string correlationId) : base(startedBy, serverCallId, correlationId) { - Argument.AssertNotNull(startedBy, nameof(startedBy)); - Argument.AssertNotNull(serverCallId, nameof(serverCallId)); - Argument.AssertNotNull(correlationId, nameof(correlationId)); } /// Initializes a new instance of . @@ -33,17 +29,12 @@ internal AcsCallParticipantAddedEventData(AcsCallParticipantProperties startedBy /// Is two-party in calling event. /// The correlationId of calling event. /// Is the calling event a room call. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The user of the call participant. /// The display name of the participant. /// The id of the participant. /// The user agent of the participant. - internal AcsCallParticipantAddedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary serializedAdditionalRawData, AcsCallParticipantProperties user, string displayName, string participantId, string userAgent) : base(startedBy, serverCallId, group, room, isTwoParty, correlationId, isRoomsCall, serializedAdditionalRawData, user, displayName, participantId, userAgent) - { - } - - /// Initializes a new instance of for deserialization. - internal AcsCallParticipantAddedEventData() + internal AcsCallParticipantAddedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties @group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary additionalBinaryDataProperties, AcsCallParticipantProperties user, string displayName, string participantId, string userAgent) : base(startedBy, serverCallId, @group, room, isTwoParty, correlationId, isRoomsCall, additionalBinaryDataProperties, user, displayName, participantId, userAgent) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.Serialization.cs index 8d1bede0e32a..7eba2ba18bb2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of all participant events. [JsonConverter(typeof(AcsCallParticipantEventDataConverter))] - public partial class AcsCallParticipantEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsCallParticipantEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallParticipantEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(User)) { @@ -59,141 +63,147 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsCallParticipantEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallParticipantEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsCallParticipantEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallParticipantEventData(document.RootElement, options); } - internal static AcsCallParticipantEventData DeserializeAcsCallParticipantEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallParticipantEventData DeserializeAcsCallParticipantEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - AcsCallParticipantProperties user = default; - string displayName = default; - string participantId = default; - string userAgent = default; AcsCallParticipantProperties startedBy = default; string serverCallId = default; - AcsCallGroupProperties group = default; + AcsCallGroupProperties @group = default; AcsCallRoomProperties room = default; bool? isTwoParty = default; string correlationId = default; bool? isRoomsCall = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + AcsCallParticipantProperties user = default; + string displayName = default; + string participantId = default; + string userAgent = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("user"u8)) + if (prop.NameEquals("startedBy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - user = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("displayName"u8)) + if (prop.NameEquals("serverCallId"u8)) { - displayName = property.Value.GetString(); + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantId"u8)) + if (prop.NameEquals("group"u8)) { - participantId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(prop.Value, options); continue; } - if (property.NameEquals("userAgent"u8)) + if (prop.NameEquals("room"u8)) { - userAgent = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(prop.Value, options); continue; } - if (property.NameEquals("startedBy"u8)) + if (prop.NameEquals("isTwoParty"u8)) { - startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isTwoParty = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("correlationId"u8)) { - serverCallId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("group"u8)) + if (prop.NameEquals("isRoomsCall"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(property.Value, options); + isRoomsCall = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("room"u8)) + if (prop.NameEquals("user"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(property.Value, options); + user = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("isTwoParty"u8)) + if (prop.NameEquals("displayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isTwoParty = property.Value.GetBoolean(); + displayName = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("participantId"u8)) { - correlationId = property.Value.GetString(); + participantId = prop.Value.GetString(); continue; } - if (property.NameEquals("isRoomsCall"u8)) + if (prop.NameEquals("userAgent"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isRoomsCall = property.Value.GetBoolean(); + userAgent = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsCallParticipantEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData, + additionalBinaryDataProperties, user, displayName, participantId, userAgent); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -203,15 +213,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AcsCallParticipantEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallParticipantEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsCallParticipantEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallParticipantEventData(document.RootElement, options); } default: @@ -219,35 +234,28 @@ AcsCallParticipantEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsCallParticipantEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallParticipantEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsCallParticipantEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsCallParticipantEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsCallParticipantEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsCallParticipantEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsCallParticipantEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.cs index 8d94cd936d61..fc767133ddd7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantEventData.cs @@ -17,12 +17,8 @@ public partial class AcsCallParticipantEventData : AcsCallingEventProperties /// The call participant who initiated the call. /// The call id of the server. /// The correlationId of calling event. - /// , or is null. internal AcsCallParticipantEventData(AcsCallParticipantProperties startedBy, string serverCallId, string correlationId) : base(startedBy, serverCallId, correlationId) { - Argument.AssertNotNull(startedBy, nameof(startedBy)); - Argument.AssertNotNull(serverCallId, nameof(serverCallId)); - Argument.AssertNotNull(correlationId, nameof(correlationId)); } /// Initializes a new instance of . @@ -33,12 +29,12 @@ internal AcsCallParticipantEventData(AcsCallParticipantProperties startedBy, str /// Is two-party in calling event. /// The correlationId of calling event. /// Is the calling event a room call. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The user of the call participant. /// The display name of the participant. /// The id of the participant. /// The user agent of the participant. - internal AcsCallParticipantEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary serializedAdditionalRawData, AcsCallParticipantProperties user, string displayName, string participantId, string userAgent) : base(startedBy, serverCallId, group, room, isTwoParty, correlationId, isRoomsCall, serializedAdditionalRawData) + internal AcsCallParticipantEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties @group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary additionalBinaryDataProperties, AcsCallParticipantProperties user, string displayName, string participantId, string userAgent) : base(startedBy, serverCallId, @group, room, isTwoParty, correlationId, isRoomsCall, additionalBinaryDataProperties) { User = user; DisplayName = displayName; @@ -46,17 +42,15 @@ internal AcsCallParticipantEventData(AcsCallParticipantProperties startedBy, str UserAgent = userAgent; } - /// Initializes a new instance of for deserialization. - internal AcsCallParticipantEventData() - { - } - /// The user of the call participant. public AcsCallParticipantProperties User { get; } + /// The display name of the participant. public string DisplayName { get; } + /// The id of the participant. public string ParticipantId { get; } + /// The user agent of the participant. public string UserAgent { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantKind.cs index e425d4240110..ca3ebf55c8e1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantKind.cs @@ -14,47 +14,72 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsCallParticipantKind : IEquatable { private readonly string _value; + /// Attendee. + private const string AttendeeValue = "Attendee"; + /// Presenter. + private const string PresenterValue = "Presenter"; + /// Organizer. + private const string OrganizerValue = "Organizer"; + /// Consumer. + private const string ConsumerValue = "Consumer"; + /// Collaborator. + private const string CollaboratorValue = "Collaborator"; /// Initializes a new instance of . + /// The value. /// is null. public AcsCallParticipantKind(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string AttendeeValue = "Attendee"; - private const string PresenterValue = "Presenter"; - private const string OrganizerValue = "Organizer"; - private const string ConsumerValue = "Consumer"; - private const string CollaboratorValue = "Collaborator"; + _value = value; + } /// Attendee. public static AcsCallParticipantKind Attendee { get; } = new AcsCallParticipantKind(AttendeeValue); + /// Presenter. public static AcsCallParticipantKind Presenter { get; } = new AcsCallParticipantKind(PresenterValue); + /// Organizer. public static AcsCallParticipantKind Organizer { get; } = new AcsCallParticipantKind(OrganizerValue); + /// Consumer. public static AcsCallParticipantKind Consumer { get; } = new AcsCallParticipantKind(ConsumerValue); + /// Collaborator. public static AcsCallParticipantKind Collaborator { get; } = new AcsCallParticipantKind(CollaboratorValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsCallParticipantKind left, AcsCallParticipantKind right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsCallParticipantKind left, AcsCallParticipantKind right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsCallParticipantKind(string value) => new AcsCallParticipantKind(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsCallParticipantKind?(string value) => value == null ? null : new AcsCallParticipantKind(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsCallParticipantKind other && Equals(other); - /// + + /// public bool Equals(AcsCallParticipantKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.Serialization.cs index 02355c432e72..bcef549c5835 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsCallParticipantProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all participant event user. + public partial class AcsCallParticipantProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(CommunicationIdentifier)) { writer.WritePropertyName("communicationIdentifier"u8); @@ -44,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("role"u8); writer.WriteStringValue(Role.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,63 +60,69 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsCallParticipantProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallParticipantProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsCallParticipantProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallParticipantProperties(document.RootElement, options); } - internal static AcsCallParticipantProperties DeserializeAcsCallParticipantProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallParticipantProperties DeserializeAcsCallParticipantProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } CommunicationIdentifierModel communicationIdentifier = default; AcsCallParticipantKind? role = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("communicationIdentifier"u8)) + if (prop.NameEquals("communicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - communicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + communicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("role"u8)) + if (prop.NameEquals("role"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - role = new AcsCallParticipantKind(property.Value.GetString()); + role = new AcsCallParticipantKind(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsCallParticipantProperties(communicationIdentifier, role, serializedAdditionalRawData); + return new AcsCallParticipantProperties(communicationIdentifier, role, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -127,15 +132,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - AcsCallParticipantProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallParticipantProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsCallParticipantProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallParticipantProperties(document.RootElement, options); } default: @@ -143,22 +153,7 @@ AcsCallParticipantProperties IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsCallParticipantProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallParticipantProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.cs index 09b1f69c7b45..7503a33cbf89 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all participant event user. public partial class AcsCallParticipantProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsCallParticipantProperties() @@ -53,16 +24,17 @@ internal AcsCallParticipantProperties() /// Initializes a new instance of . /// The communication identifier of the participant user. /// The role of the participant. - /// Keeps track of any properties unknown to the library. - internal AcsCallParticipantProperties(CommunicationIdentifierModel communicationIdentifier, AcsCallParticipantKind? role, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsCallParticipantProperties(CommunicationIdentifierModel communicationIdentifier, AcsCallParticipantKind? role, IDictionary additionalBinaryDataProperties) { CommunicationIdentifier = communicationIdentifier; Role = role; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The communication identifier of the participant user. public CommunicationIdentifierModel CommunicationIdentifier { get; } + /// The role of the participant. public AcsCallParticipantKind? Role { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.Serialization.cs index 3ee5432fbe29..85e0368d2fc5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantRemoved event. [JsonConverter(typeof(AcsCallParticipantRemovedEventDataConverter))] - public partial class AcsCallParticipantRemovedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsCallParticipantRemovedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallParticipantRemovedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,150 +35,155 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantRemovedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AcsCallParticipantRemovedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallParticipantRemovedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsCallParticipantRemovedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallParticipantRemovedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallParticipantRemovedEventData(document.RootElement, options); } - internal static AcsCallParticipantRemovedEventData DeserializeAcsCallParticipantRemovedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallParticipantRemovedEventData DeserializeAcsCallParticipantRemovedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - AcsCallParticipantProperties user = default; - string displayName = default; - string participantId = default; - string userAgent = default; AcsCallParticipantProperties startedBy = default; string serverCallId = default; - AcsCallGroupProperties group = default; + AcsCallGroupProperties @group = default; AcsCallRoomProperties room = default; bool? isTwoParty = default; string correlationId = default; bool? isRoomsCall = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + AcsCallParticipantProperties user = default; + string displayName = default; + string participantId = default; + string userAgent = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("user"u8)) + if (prop.NameEquals("startedBy"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - user = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("displayName"u8)) + if (prop.NameEquals("serverCallId"u8)) { - displayName = property.Value.GetString(); + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantId"u8)) + if (prop.NameEquals("group"u8)) { - participantId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(prop.Value, options); continue; } - if (property.NameEquals("userAgent"u8)) + if (prop.NameEquals("room"u8)) { - userAgent = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(prop.Value, options); continue; } - if (property.NameEquals("startedBy"u8)) + if (prop.NameEquals("isTwoParty"u8)) { - startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isTwoParty = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("correlationId"u8)) { - serverCallId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("group"u8)) + if (prop.NameEquals("isRoomsCall"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(property.Value, options); + isRoomsCall = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("room"u8)) + if (prop.NameEquals("user"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(property.Value, options); + user = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("isTwoParty"u8)) + if (prop.NameEquals("displayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isTwoParty = property.Value.GetBoolean(); + displayName = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("participantId"u8)) { - correlationId = property.Value.GetString(); + participantId = prop.Value.GetString(); continue; } - if (property.NameEquals("isRoomsCall"u8)) + if (prop.NameEquals("userAgent"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isRoomsCall = property.Value.GetBoolean(); + userAgent = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsCallParticipantRemovedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData, + additionalBinaryDataProperties, user, displayName, participantId, userAgent); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -183,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - AcsCallParticipantRemovedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallParticipantRemovedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsCallParticipantRemovedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallParticipantRemovedEventData(document.RootElement, options); } default: @@ -199,35 +214,28 @@ AcsCallParticipantRemovedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsCallParticipantRemovedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallParticipantRemovedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsCallParticipantRemovedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsCallParticipantRemovedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsCallParticipantRemovedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsCallParticipantRemovedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsCallParticipantRemovedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.cs index 68fd31c906d2..c5eedff07cc5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallParticipantRemovedEventData.cs @@ -17,12 +17,8 @@ public partial class AcsCallParticipantRemovedEventData : AcsCallParticipantEven /// The call participant who initiated the call. /// The call id of the server. /// The correlationId of calling event. - /// , or is null. internal AcsCallParticipantRemovedEventData(AcsCallParticipantProperties startedBy, string serverCallId, string correlationId) : base(startedBy, serverCallId, correlationId) { - Argument.AssertNotNull(startedBy, nameof(startedBy)); - Argument.AssertNotNull(serverCallId, nameof(serverCallId)); - Argument.AssertNotNull(correlationId, nameof(correlationId)); } /// Initializes a new instance of . @@ -33,17 +29,12 @@ internal AcsCallParticipantRemovedEventData(AcsCallParticipantProperties started /// Is two-party in calling event. /// The correlationId of calling event. /// Is the calling event a room call. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The user of the call participant. /// The display name of the participant. /// The id of the participant. /// The user agent of the participant. - internal AcsCallParticipantRemovedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary serializedAdditionalRawData, AcsCallParticipantProperties user, string displayName, string participantId, string userAgent) : base(startedBy, serverCallId, group, room, isTwoParty, correlationId, isRoomsCall, serializedAdditionalRawData, user, displayName, participantId, userAgent) - { - } - - /// Initializes a new instance of for deserialization. - internal AcsCallParticipantRemovedEventData() + internal AcsCallParticipantRemovedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties @group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary additionalBinaryDataProperties, AcsCallParticipantProperties user, string displayName, string participantId, string userAgent) : base(startedBy, serverCallId, @group, room, isTwoParty, correlationId, isRoomsCall, additionalBinaryDataProperties, user, displayName, participantId, userAgent) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.Serialization.cs index 29a5accba97f..d3e44eb3d955 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsCallRoomProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of calling event room properties. + public partial class AcsCallRoomProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallRoomProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,49 +55,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsCallRoomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallRoomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsCallRoomProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallRoomProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallRoomProperties(document.RootElement, options); } - internal static AcsCallRoomProperties DeserializeAcsCallRoomProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallRoomProperties DeserializeAcsCallRoomProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsCallRoomProperties(id, serializedAdditionalRawData); + return new AcsCallRoomProperties(id, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -108,15 +113,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - AcsCallRoomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallRoomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsCallRoomProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallRoomProperties(document.RootElement, options); } default: @@ -124,22 +134,7 @@ AcsCallRoomProperties IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsCallRoomProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallRoomProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.cs index 85fc5ddad67b..6babcfe89985 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallRoomProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of calling event room properties. public partial class AcsCallRoomProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsCallRoomProperties() @@ -52,11 +23,11 @@ internal AcsCallRoomProperties() /// Initializes a new instance of . /// Room Id. - /// Keeps track of any properties unknown to the library. - internal AcsCallRoomProperties(string id, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsCallRoomProperties(string id, IDictionary additionalBinaryDataProperties) { Id = id; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Room Id. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.Serialization.cs index ba9ffd996949..97c183509406 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallStarted event. [JsonConverter(typeof(AcsCallStartedEventDataConverter))] - public partial class AcsCallStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsCallStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallStartedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,118 +35,123 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallStartedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AcsCallStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsCallStartedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallStartedEventData(document.RootElement, options); } - internal static AcsCallStartedEventData DeserializeAcsCallStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallStartedEventData DeserializeAcsCallStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } AcsCallParticipantProperties startedBy = default; string serverCallId = default; - AcsCallGroupProperties group = default; + AcsCallGroupProperties @group = default; AcsCallRoomProperties room = default; bool? isTwoParty = default; string correlationId = default; bool? isRoomsCall = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("startedBy"u8)) + if (prop.NameEquals("startedBy"u8)) { - startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("serverCallId"u8)) { - serverCallId = property.Value.GetString(); + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("group"u8)) + if (prop.NameEquals("group"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(property.Value, options); + @group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(prop.Value, options); continue; } - if (property.NameEquals("room"u8)) + if (prop.NameEquals("room"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(property.Value, options); + room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(prop.Value, options); continue; } - if (property.NameEquals("isTwoParty"u8)) + if (prop.NameEquals("isTwoParty"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isTwoParty = property.Value.GetBoolean(); + isTwoParty = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("isRoomsCall"u8)) + if (prop.NameEquals("isRoomsCall"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isRoomsCall = property.Value.GetBoolean(); + isRoomsCall = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsCallStartedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -151,15 +161,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - AcsCallStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsCallStartedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsCallingEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallStartedEventData(document.RootElement, options); } default: @@ -167,35 +182,28 @@ AcsCallStartedEventData IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsCallStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallStartedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsCallStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsCallStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsCallStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsCallStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsCallStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.cs index 084316dc68df..3b54d8456023 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallStartedEventData.cs @@ -17,12 +17,8 @@ public partial class AcsCallStartedEventData : AcsCallingEventProperties /// The call participant who initiated the call. /// The call id of the server. /// The correlationId of calling event. - /// , or is null. internal AcsCallStartedEventData(AcsCallParticipantProperties startedBy, string serverCallId, string correlationId) : base(startedBy, serverCallId, correlationId) { - Argument.AssertNotNull(startedBy, nameof(startedBy)); - Argument.AssertNotNull(serverCallId, nameof(serverCallId)); - Argument.AssertNotNull(correlationId, nameof(correlationId)); } /// Initializes a new instance of . @@ -33,13 +29,8 @@ internal AcsCallStartedEventData(AcsCallParticipantProperties startedBy, string /// Is two-party in calling event. /// The correlationId of calling event. /// Is the calling event a room call. - /// Keeps track of any properties unknown to the library. - internal AcsCallStartedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary serializedAdditionalRawData) : base(startedBy, serverCallId, group, room, isTwoParty, correlationId, isRoomsCall, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AcsCallStartedEventData() + /// Keeps track of any properties unknown to the library. + internal AcsCallStartedEventData(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties @group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary additionalBinaryDataProperties) : base(startedBy, serverCallId, @group, room, isTwoParty, correlationId, isRoomsCall, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.Serialization.cs index b08680fc858a..0de8b197c621 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsCallingEventProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all calling events. + public partial class AcsCallingEventProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsCallingEventProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallingEventProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("startedBy"u8); writer.WriteObjectValue(StartedBy, options); writer.WritePropertyName("serverCallId"u8); @@ -60,15 +64,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("isRoomsCall"u8); writer.WriteBooleanValue(IsRoomsCall.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -77,109 +81,115 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsCallingEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsCallingEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsCallingEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsCallingEventProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsCallingEventProperties(document.RootElement, options); } - internal static AcsCallingEventProperties DeserializeAcsCallingEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsCallingEventProperties DeserializeAcsCallingEventProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } AcsCallParticipantProperties startedBy = default; string serverCallId = default; - AcsCallGroupProperties group = default; + AcsCallGroupProperties @group = default; AcsCallRoomProperties room = default; bool? isTwoParty = default; string correlationId = default; bool? isRoomsCall = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("startedBy"u8)) + if (prop.NameEquals("startedBy"u8)) { - startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(property.Value, options); + startedBy = AcsCallParticipantProperties.DeserializeAcsCallParticipantProperties(prop.Value, options); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("serverCallId"u8)) { - serverCallId = property.Value.GetString(); + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("group"u8)) + if (prop.NameEquals("group"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(property.Value, options); + @group = AcsCallGroupProperties.DeserializeAcsCallGroupProperties(prop.Value, options); continue; } - if (property.NameEquals("room"u8)) + if (prop.NameEquals("room"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(property.Value, options); + room = AcsCallRoomProperties.DeserializeAcsCallRoomProperties(prop.Value, options); continue; } - if (property.NameEquals("isTwoParty"u8)) + if (prop.NameEquals("isTwoParty"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isTwoParty = property.Value.GetBoolean(); + isTwoParty = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("isRoomsCall"u8)) + if (prop.NameEquals("isRoomsCall"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isRoomsCall = property.Value.GetBoolean(); + isRoomsCall = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsCallingEventProperties( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -189,15 +199,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - AcsCallingEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsCallingEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsCallingEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsCallingEventProperties(document.RootElement, options); } default: @@ -205,22 +220,7 @@ AcsCallingEventProperties IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsCallingEventProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsCallingEventProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.cs index 0c4873031004..31c7035062d3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCallingEventProperties.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all calling events. public partial class AcsCallingEventProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The call participant who initiated the call. /// The call id of the server. /// The correlationId of calling event. - /// , or is null. internal AcsCallingEventProperties(AcsCallParticipantProperties startedBy, string serverCallId, string correlationId) { - Argument.AssertNotNull(startedBy, nameof(startedBy)); - Argument.AssertNotNull(serverCallId, nameof(serverCallId)); - Argument.AssertNotNull(correlationId, nameof(correlationId)); - StartedBy = startedBy; ServerCallId = serverCallId; CorrelationId = correlationId; @@ -69,36 +35,37 @@ internal AcsCallingEventProperties(AcsCallParticipantProperties startedBy, strin /// Is two-party in calling event. /// The correlationId of calling event. /// Is the calling event a room call. - /// Keeps track of any properties unknown to the library. - internal AcsCallingEventProperties(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsCallingEventProperties(AcsCallParticipantProperties startedBy, string serverCallId, AcsCallGroupProperties @group, AcsCallRoomProperties room, bool? isTwoParty, string correlationId, bool? isRoomsCall, IDictionary additionalBinaryDataProperties) { StartedBy = startedBy; ServerCallId = serverCallId; - Group = group; + Group = @group; Room = room; IsTwoParty = isTwoParty; CorrelationId = correlationId; IsRoomsCall = isRoomsCall; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsCallingEventProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The call participant who initiated the call. public AcsCallParticipantProperties StartedBy { get; } + /// The call id of the server. public string ServerCallId { get; } + /// The group metadata. public AcsCallGroupProperties Group { get; } + /// The room metadata. public AcsCallRoomProperties Room { get; } + /// Is two-party in calling event. public bool? IsTwoParty { get; } + /// The correlationId of calling event. public string CorrelationId { get; } + /// Is the calling event a room call. public bool? IsRoomsCall { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs index b7fea78959ba..0c97a1eef395 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatAzureBotCommandReceivedInThread event. [JsonConverter(typeof(AcsChatAzureBotCommandReceivedInThreadEventDataConverter))] - public partial class AcsChatAzureBotCommandReceivedInThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatAzureBotCommandReceivedInThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatAzureBotCommandReceivedInThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatAzureBotCommandReceivedInThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); @@ -46,137 +50,155 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } } - AcsChatAzureBotCommandReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatAzureBotCommandReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatAzureBotCommandReceivedInThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatAzureBotCommandReceivedInThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(document.RootElement, options); } - internal static AcsChatAzureBotCommandReceivedInThreadEventData DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatAzureBotCommandReceivedInThreadEventData DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageBody = default; - IReadOnlyDictionary metadata = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageBody = default; + IDictionary metadata = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageBody"u8)) + if (prop.NameEquals("transactionId"u8)) { - messageBody = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - senderDisplayName = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("messageBody"u8)) { - transactionId = property.Value.GetString(); + messageBody = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("metadata"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatAzureBotCommandReceivedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata ?? new ChangeTrackingDictionary()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -186,15 +208,20 @@ BinaryData IPersistableModel.Wr } } - AcsChatAzureBotCommandReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatAzureBotCommandReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatAzureBotCommandReceivedInThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(document.RootElement, options); } default: @@ -202,35 +229,28 @@ AcsChatAzureBotCommandReceivedInThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatAzureBotCommandReceivedInThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatAzureBotCommandReceivedInThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatAzureBotCommandReceivedInThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatAzureBotCommandReceivedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatAzureBotCommandReceivedInThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs index 919251bdce5a..9f280b42d39e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs @@ -19,15 +19,8 @@ public partial class AcsChatAzureBotCommandReceivedInThreadEventData : AcsChatMe /// The communication identifier of the sender. /// The type of the message. /// The body of the chat message. - /// , , , or is null. - internal AcsChatAzureBotCommandReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatAzureBotCommandReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - Argument.AssertNotNull(messageBody, nameof(messageBody)); - MessageBody = messageBody; Metadata = new ChangeTrackingDictionary(); } @@ -35,7 +28,7 @@ internal AcsChatAzureBotCommandReceivedInThreadEventData(string threadId, string /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -44,20 +37,16 @@ internal AcsChatAzureBotCommandReceivedInThreadEventData(string threadId, string /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; } - /// Initializes a new instance of for deserialization. - internal AcsChatAzureBotCommandReceivedInThreadEventData() - { - } - /// The body of the chat message. public string MessageBody { get; } + /// The chat message metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs index 18c1b8e175ba..0d4e203c07b0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatEventBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all chat events. + public partial class AcsChatEventBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatEventBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatEventBaseProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("recipientCommunicationIdentifier"u8); writer.WriteObjectValue(RecipientCommunicationIdentifier, options); if (Optional.IsDefined(TransactionId)) @@ -43,15 +47,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("threadId"u8); writer.WriteStringValue(ThreadId); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -60,22 +64,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsChatEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatEventBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatEventBaseProperties(document.RootElement, options); } - internal static AcsChatEventBaseProperties DeserializeAcsChatEventBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatEventBaseProperties DeserializeAcsChatEventBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -83,38 +92,39 @@ internal static AcsChatEventBaseProperties DeserializeAcsChatEventBaseProperties CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("transactionId"u8)) { - transactionId = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("threadId"u8)) { - threadId = property.Value.GetString(); + threadId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData); + return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -124,15 +134,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - AcsChatEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatEventBaseProperties(document.RootElement, options); } default: @@ -140,22 +155,7 @@ AcsChatEventBaseProperties IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsChatEventBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatEventBaseProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs index 54f025db262c..d0cd9c068047 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all chat events. public partial class AcsChatEventBaseProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The communication identifier of the target user. /// The chat thread id. - /// or is null. internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - RecipientCommunicationIdentifier = recipientCommunicationIdentifier; ThreadId = threadId; } @@ -62,24 +29,21 @@ internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommun /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. - internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties) { RecipientCommunicationIdentifier = recipientCommunicationIdentifier; TransactionId = transactionId; ThreadId = threadId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsChatEventBaseProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The communication identifier of the target user. public CommunicationIdentifierModel RecipientCommunicationIdentifier { get; } + /// The transaction id will be used as co-relation vector. public string TransactionId { get; } + /// The chat thread id. public string ThreadId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs index 9457972cb6c8..0e3b8a8a6acd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatEventInThreadBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all thread-level chat events. + public partial class AcsChatEventInThreadBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatEventInThreadBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatEventInThreadBaseProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TransactionId)) { writer.WritePropertyName("transactionId"u8); @@ -41,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("threadId"u8); writer.WriteStringValue(ThreadId); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,55 +62,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsChatEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatEventInThreadBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement, options); } - internal static AcsChatEventInThreadBaseProperties DeserializeAcsChatEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatEventInThreadBaseProperties DeserializeAcsChatEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("transactionId"u8)) { - transactionId = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("threadId"u8)) { - threadId = property.Value.GetString(); + threadId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsChatEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData); + return new AcsChatEventInThreadBaseProperties(transactionId, threadId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -116,15 +126,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - AcsChatEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement, options); } default: @@ -132,22 +147,7 @@ AcsChatEventInThreadBaseProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsChatEventInThreadBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs index 7648670599d0..048eab930608 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs @@ -13,66 +13,30 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all thread-level chat events. public partial class AcsChatEventInThreadBaseProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The chat thread id. - /// is null. internal AcsChatEventInThreadBaseProperties(string threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - ThreadId = threadId; } /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. - internal AcsChatEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsChatEventInThreadBaseProperties(string transactionId, string threadId, IDictionary additionalBinaryDataProperties) { TransactionId = transactionId; ThreadId = threadId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsChatEventInThreadBaseProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The transaction id will be used as co-relation vector. public string TransactionId { get; } + /// The chat thread id. public string ThreadId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs index b0906345bce1..7db168d9e6ef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event. [JsonConverter(typeof(AcsChatMessageDeletedEventDataConverter))] - public partial class AcsChatMessageDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatMessageDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(DeleteTime)) { @@ -44,126 +48,132 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatMessageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageDeletedEventData(document.RootElement, options); } - internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? deleteTime = default; + CommunicationIdentifierModel recipientCommunicationIdentifier = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - CommunicationIdentifierModel recipientCommunicationIdentifier = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? deleteTime = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deleteTime"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - deleteTime = property.Value.GetDateTimeOffset("O"); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("transactionId"u8)) { - messageId = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("threadId"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("messageId"u8)) { - senderDisplayName = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - composeTime = property.Value.GetDateTimeOffset("O"); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - type = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("type"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("version"u8)) { - transactionId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("deleteTime"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageDeletedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, deleteTime); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -173,15 +183,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - AcsChatMessageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageDeletedEventData(document.RootElement, options); } default: @@ -189,35 +204,28 @@ AcsChatMessageDeletedEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatMessageDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatMessageDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatMessageDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatMessageDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs index ab6faf874410..8e4992812b9a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs @@ -19,21 +19,15 @@ public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBasePro /// The chat message id. /// The communication identifier of the sender. /// The type of the message. - /// , , , or is null. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type) : base(recipientCommunicationIdentifier, threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type) : base(recipientCommunicationIdentifier, threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); } /// Initializes a new instance of . /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -41,16 +35,11 @@ internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCo /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { DeleteTime = deleteTime; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageDeletedEventData() - { - } - /// The time at which the message was deleted. public DateTimeOffset? DeleteTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs index 244ed09f125c..3deb6118387f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event. [JsonConverter(typeof(AcsChatMessageDeletedInThreadEventDataConverter))] - public partial class AcsChatMessageDeletedInThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatMessageDeletedInThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageDeletedInThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageDeletedInThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(DeleteTime)) { @@ -44,119 +48,125 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatMessageDeletedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageDeletedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageDeletedInThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageDeletedInThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement, options); } - internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessageDeletedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessageDeletedInThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? deleteTime = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? deleteTime = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deleteTime"u8)) + if (prop.NameEquals("transactionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - deleteTime = property.Value.GetDateTimeOffset("O"); + transactionId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("threadId"u8)) + { + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - senderDisplayName = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("transactionId"u8)) - { - transactionId = property.Value.GetString(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("deleteTime"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageDeletedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, deleteTime); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -166,15 +176,20 @@ BinaryData IPersistableModel.Write(Model } } - AcsChatMessageDeletedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageDeletedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageDeletedInThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement, options); } default: @@ -182,35 +197,28 @@ AcsChatMessageDeletedInThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageDeletedInThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatMessageDeletedInThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatMessageDeletedInThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatMessageDeletedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs index 085d7b6de3b0..957120a41d90 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs @@ -18,19 +18,14 @@ public partial class AcsChatMessageDeletedInThreadEventData : AcsChatMessageEven /// The chat message id. /// The communication identifier of the sender. /// The type of the message. - /// , , or is null. - internal AcsChatMessageDeletedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type) : base(threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatMessageDeletedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type) : base(threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); } /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -38,16 +33,11 @@ internal AcsChatMessageDeletedInThreadEventData(string threadId, string messageI /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal AcsChatMessageDeletedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, DateTimeOffset? deleteTime) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { DeleteTime = deleteTime; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageDeletedInThreadEventData() - { - } - /// The time at which the message was deleted. public DateTimeOffset? DeleteTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs index c33e21cc5570..ece42e67b99f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event. [JsonConverter(typeof(AcsChatMessageEditedEventDataConverter))] - public partial class AcsChatMessageEditedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatMessageEditedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageEditedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEditedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); @@ -46,6 +50,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -57,149 +66,162 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatMessageEditedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageEditedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageEditedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEditedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageEditedEventData(document.RootElement, options); } - internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageBody = default; - IReadOnlyDictionary metadata = default; - DateTimeOffset? editTime = default; + CommunicationIdentifierModel recipientCommunicationIdentifier = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - CommunicationIdentifierModel recipientCommunicationIdentifier = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageBody = default; + IDictionary metadata = default; + DateTimeOffset? editTime = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageBody"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - messageBody = property.Value.GetString(); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("transactionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("editTime"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - editTime = property.Value.GetDateTimeOffset("O"); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - senderDisplayName = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("messageBody"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + messageBody = prop.Value.GetString(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("metadata"u8)) { - transactionId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("editTime"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + editTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageEditedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata ?? new ChangeTrackingDictionary(), editTime); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -209,15 +231,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AcsChatMessageEditedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageEditedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageEditedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageEditedEventData(document.RootElement, options); } default: @@ -225,35 +252,28 @@ AcsChatMessageEditedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageEditedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageEditedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatMessageEditedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatMessageEditedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatMessageEditedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatMessageEditedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEditedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs index f8e58f011f23..d4a47cead0f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs @@ -20,16 +20,8 @@ public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProp /// The communication identifier of the sender. /// The type of the message. /// The body of the chat message. - /// , , , , or is null. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type, string messageBody) : base(recipientCommunicationIdentifier, threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type, string messageBody) : base(recipientCommunicationIdentifier, threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - Argument.AssertNotNull(messageBody, nameof(messageBody)); - MessageBody = messageBody; Metadata = new ChangeTrackingDictionary(); } @@ -38,7 +30,7 @@ internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCom /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -48,22 +40,19 @@ internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCom /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; EditTime = editTime; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageEditedEventData() - { - } - /// The body of the chat message. public string MessageBody { get; } + /// The chat message metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } + /// The time at which the message was edited. public DateTimeOffset? EditTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs index 020e2eca581a..34844b6d4d16 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event. [JsonConverter(typeof(AcsChatMessageEditedInThreadEventDataConverter))] - public partial class AcsChatMessageEditedInThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatMessageEditedInThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageEditedInThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEditedInThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); @@ -46,6 +50,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -57,142 +66,155 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatMessageEditedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageEditedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageEditedInThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEditedInThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement, options); } - internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageEditedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageEditedInThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageBody = default; - IReadOnlyDictionary metadata = default; - DateTimeOffset? editTime = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageBody = default; + IDictionary metadata = default; + DateTimeOffset? editTime = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageBody"u8)) + if (prop.NameEquals("transactionId"u8)) { - messageBody = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("editTime"u8)) + if (prop.NameEquals("messageId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - editTime = property.Value.GetDateTimeOffset("O"); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - messageId = property.Value.GetString(); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("composeTime"u8)) { - senderDisplayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("composeTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); + continue; + } + if (prop.NameEquals("messageBody"u8)) + { + messageBody = prop.Value.GetString(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("metadata"u8)) { - transactionId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("editTime"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + editTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageEditedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata ?? new ChangeTrackingDictionary(), editTime); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -202,15 +224,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsChatMessageEditedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageEditedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageEditedInThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement, options); } default: @@ -218,35 +245,28 @@ AcsChatMessageEditedInThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageEditedInThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatMessageEditedInThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatMessageEditedInThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatMessageEditedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs index 8d7ba4725066..e67e7490787e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs @@ -19,15 +19,8 @@ public partial class AcsChatMessageEditedInThreadEventData : AcsChatMessageEvent /// The communication identifier of the sender. /// The type of the message. /// The body of the chat message. - /// , , , or is null. - internal AcsChatMessageEditedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatMessageEditedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - Argument.AssertNotNull(messageBody, nameof(messageBody)); - MessageBody = messageBody; Metadata = new ChangeTrackingDictionary(); } @@ -35,7 +28,7 @@ internal AcsChatMessageEditedInThreadEventData(string threadId, string messageId /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -45,22 +38,19 @@ internal AcsChatMessageEditedInThreadEventData(string threadId, string messageId /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata, DateTimeOffset? editTime) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; EditTime = editTime; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageEditedInThreadEventData() - { - } - /// The body of the chat message. public string MessageBody { get; } + /// The chat message metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } + /// The time at which the message was edited. public DateTimeOffset? EditTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs index 75098026e6a7..4fa8262ad272 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatMessageEventBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all chat message events. + public partial class AcsChatMessageEventBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageEventBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEventBaseProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); @@ -58,115 +62,121 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatMessageEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageEventBaseProperties)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEventBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageEventBaseProperties(document.RootElement, options); } - internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEventBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEventBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + CommunicationIdentifierModel recipientCommunicationIdentifier = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - CommunicationIdentifierModel recipientCommunicationIdentifier = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - messageId = property.Value.GetString(); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("threadId"u8)) { - senderDisplayName = property.Value.GetString(); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("messageId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - composeTime = property.Value.GetDateTimeOffset("O"); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - type = property.Value.GetString(); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("composeTime"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("type"u8)) { - transactionId = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("version"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageEventBaseProperties( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -176,15 +186,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - AcsChatMessageEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageEventBaseProperties)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageEventBaseProperties(document.RootElement, options); } default: @@ -192,22 +207,7 @@ AcsChatMessageEventBaseProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageEventBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageEventBaseProperties(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs index 640ebaac0733..3234ebfa0cdf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs @@ -19,56 +19,49 @@ public partial class AcsChatMessageEventBaseProperties : AcsChatEventBasePropert /// The chat message id. /// The communication identifier of the sender. /// The type of the message. - /// , , , or is null. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type) : base(recipientCommunicationIdentifier, threadId) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; - Type = type; + Type = @type; } /// Initializes a new instance of . /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; SenderDisplayName = senderDisplayName; ComposeTime = composeTime; - Type = type; + Type = @type; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageEventBaseProperties() - { - } - /// The chat message id. public string MessageId { get; } + /// The communication identifier of the sender. public CommunicationIdentifierModel SenderCommunicationIdentifier { get; } + /// The display name of the sender. public string SenderDisplayName { get; } + /// The original compose time of the message. public DateTimeOffset? ComposeTime { get; } + /// The type of the message. public string Type { get; } + /// The version of the message. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs index 2921ac52b9b9..686bca33690a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatMessageEventInThreadBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all thread-level chat message events. + public partial class AcsChatMessageEventInThreadBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageEventInThreadBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEventInThreadBaseProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); @@ -58,108 +62,114 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatMessageEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageEventInThreadBaseProperties)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageEventInThreadBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement, options); } - internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMessageEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMessageEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("transactionId"u8)) { - messageId = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("threadId"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("messageId"u8)) { - senderDisplayName = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - composeTime = property.Value.GetDateTimeOffset("O"); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - type = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("type"u8)) { - transactionId = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("version"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageEventInThreadBaseProperties( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -169,15 +179,20 @@ BinaryData IPersistableModel.Write(Mo } } - AcsChatMessageEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageEventInThreadBaseProperties)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement, options); } default: @@ -185,22 +200,7 @@ AcsChatMessageEventInThreadBaseProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageEventInThreadBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs index a15c487d6853..b944e98121d5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs @@ -18,54 +18,48 @@ public partial class AcsChatMessageEventInThreadBaseProperties : AcsChatEventInT /// The chat message id. /// The communication identifier of the sender. /// The type of the message. - /// , , or is null. - internal AcsChatMessageEventInThreadBaseProperties(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type) : base(threadId) + internal AcsChatMessageEventInThreadBaseProperties(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; - Type = type; + Type = @type; } /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal AcsChatMessageEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatMessageEventInThreadBaseProperties(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version) : base(transactionId, threadId, additionalBinaryDataProperties) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; SenderDisplayName = senderDisplayName; ComposeTime = composeTime; - Type = type; + Type = @type; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageEventInThreadBaseProperties() - { - } - /// The chat message id. public string MessageId { get; } + /// The communication identifier of the sender. public CommunicationIdentifierModel SenderCommunicationIdentifier { get; } + /// The display name of the sender. public string SenderDisplayName { get; } + /// The original compose time of the message. public DateTimeOffset? ComposeTime { get; } + /// The type of the message. public string Type { get; } + /// The version of the message. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs index 419d6ba4ed46..031b2edaaaf0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event. [JsonConverter(typeof(AcsChatMessageReceivedEventDataConverter))] - public partial class AcsChatMessageReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatMessageReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageReceivedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageReceivedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); @@ -46,144 +50,162 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } } - AcsChatMessageReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageReceivedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageReceivedEventData(document.RootElement, options); } - internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageBody = default; - IReadOnlyDictionary metadata = default; + CommunicationIdentifierModel recipientCommunicationIdentifier = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - CommunicationIdentifierModel recipientCommunicationIdentifier = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageBody = default; + IDictionary metadata = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageBody"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - messageBody = property.Value.GetString(); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("transactionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("threadId"u8)) { - messageId = property.Value.GetString(); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("messageId"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - senderDisplayName = property.Value.GetString(); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + senderDisplayName = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("composeTime"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("messageBody"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + messageBody = prop.Value.GetString(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("metadata"u8)) { - transactionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("threadId"u8)) - { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageReceivedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata ?? new ChangeTrackingDictionary()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -193,15 +215,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsChatMessageReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageReceivedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageReceivedEventData(document.RootElement, options); } default: @@ -209,35 +236,28 @@ AcsChatMessageReceivedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatMessageReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatMessageReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatMessageReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatMessageReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs index 481aac65bc83..5c76f3a7d17a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs @@ -20,16 +20,8 @@ public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBasePr /// The communication identifier of the sender. /// The type of the message. /// The body of the chat message. - /// , , , , or is null. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type, string messageBody) : base(recipientCommunicationIdentifier, threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type, string messageBody) : base(recipientCommunicationIdentifier, threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - Argument.AssertNotNull(messageBody, nameof(messageBody)); - MessageBody = messageBody; Metadata = new ChangeTrackingDictionary(); } @@ -38,7 +30,7 @@ internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientC /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -47,20 +39,16 @@ internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientC /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageReceivedEventData() - { - } - /// The body of the chat message. public string MessageBody { get; } + /// The chat message metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs index 402f778d8220..fd045850e4cc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event. [JsonConverter(typeof(AcsChatMessageReceivedInThreadEventDataConverter))] - public partial class AcsChatMessageReceivedInThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatMessageReceivedInThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatMessageReceivedInThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageReceivedInThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); @@ -46,137 +50,155 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } } - AcsChatMessageReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatMessageReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatMessageReceivedInThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatMessageReceivedInThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement, options); } - internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessageReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessageReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageBody = default; - IReadOnlyDictionary metadata = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageBody = default; + IDictionary metadata = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageBody"u8)) + if (prop.NameEquals("transactionId"u8)) { - messageBody = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - senderDisplayName = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("messageBody"u8)) { - transactionId = property.Value.GetString(); + messageBody = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("metadata"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatMessageReceivedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata ?? new ChangeTrackingDictionary()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -186,15 +208,20 @@ BinaryData IPersistableModel.Write(Mode } } - AcsChatMessageReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatMessageReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatMessageReceivedInThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement, options); } default: @@ -202,35 +229,28 @@ AcsChatMessageReceivedInThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatMessageReceivedInThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatMessageReceivedInThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatMessageReceivedInThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatMessageReceivedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs index 3e0405cc8453..2e13caac76d4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs @@ -19,15 +19,8 @@ public partial class AcsChatMessageReceivedInThreadEventData : AcsChatMessageEve /// The communication identifier of the sender. /// The type of the message. /// The body of the chat message. - /// , , , or is null. - internal AcsChatMessageReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatMessageReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - Argument.AssertNotNull(messageBody, nameof(messageBody)); - MessageBody = messageBody; Metadata = new ChangeTrackingDictionary(); } @@ -35,7 +28,7 @@ internal AcsChatMessageReceivedInThreadEventData(string threadId, string message /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -44,20 +37,16 @@ internal AcsChatMessageReceivedInThreadEventData(string threadId, string message /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; } - /// Initializes a new instance of for deserialization. - internal AcsChatMessageReceivedInThreadEventData() - { - } - /// The body of the chat message. public string MessageBody { get; } + /// The chat message metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs index 845d51463490..6acfb89c076a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event. [JsonConverter(typeof(AcsChatParticipantAddedToThreadEventDataConverter))] - public partial class AcsChatParticipantAddedToThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatParticipantAddedToThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatParticipantAddedToThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Time)) { @@ -53,94 +57,100 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatParticipantAddedToThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatParticipantAddedToThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatParticipantAddedToThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement, options); } - internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParticipantAddedToThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParticipantAddedToThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("time"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - time = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("addedByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantAdded"u8)) + if (prop.NameEquals("threadId"u8)) { - participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("time"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + time = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("addedByCommunicationIdentifier"u8)) { - transactionId = property.Value.GetString(); + addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("participantAdded"u8)) { - threadId = property.Value.GetString(); + participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(prop.Value, options); + continue; + } + if (prop.NameEquals("version"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatParticipantAddedToThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, time, addedByCommunicationIdentifier, participantAdded, version); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -150,15 +160,20 @@ BinaryData IPersistableModel.Write(Mod } } - AcsChatParticipantAddedToThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatParticipantAddedToThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatParticipantAddedToThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement, options); } default: @@ -166,35 +181,28 @@ AcsChatParticipantAddedToThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatParticipantAddedToThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatParticipantAddedToThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatParticipantAddedToThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatParticipantAddedToThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs index de246568de34..3df157bfa42b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs @@ -17,13 +17,8 @@ public partial class AcsChatParticipantAddedToThreadEventData : AcsChatEventInTh /// The chat thread id. /// The communication identifier of the user who added the user. /// The details of the user who was added. - /// , or is null. internal AcsChatParticipantAddedToThreadEventData(string threadId, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); - Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -31,12 +26,12 @@ internal AcsChatParticipantAddedToThreadEventData(string threadId, Communication /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. /// The version of the thread. - internal AcsChatParticipantAddedToThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatParticipantAddedToThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, additionalBinaryDataProperties) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -44,17 +39,15 @@ internal AcsChatParticipantAddedToThreadEventData(string transactionId, string t Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatParticipantAddedToThreadEventData() - { - } - /// The time at which the user was added to the thread. public DateTimeOffset? Time { get; } + /// The communication identifier of the user who added the user. public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } + /// The details of the user who was added. public AcsChatThreadParticipantProperties ParticipantAdded { get; } + /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs index a06aa6a3b706..0780d5f41e4e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. [JsonConverter(typeof(AcsChatParticipantAddedToThreadWithUserEventDataConverter))] - public partial class AcsChatParticipantAddedToThreadWithUserEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatParticipantAddedToThreadWithUserEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatParticipantAddedToThreadWithUserEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8Json /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadWithUserEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Time)) { @@ -48,101 +52,104 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(ParticipantAdded, options); } - AcsChatParticipantAddedToThreadWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatParticipantAddedToThreadWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatParticipantAddedToThreadWithUserEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadWithUserEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement, options); } - internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsChatParticipantAddedToThreadWithUserEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsChatParticipantAddedToThreadWithUserEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? time = default; - CommunicationIdentifierModel addedByCommunicationIdentifier = default; - AcsChatThreadParticipantProperties participantAdded = default; - DateTimeOffset? createTime = default; - long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + DateTimeOffset? time = default; + CommunicationIdentifierModel addedByCommunicationIdentifier = default; + AcsChatThreadParticipantProperties participantAdded = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("time"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - time = property.Value.GetDateTimeOffset("O"); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("addedByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantAdded"u8)) + if (prop.NameEquals("threadId"u8)) { - participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("createTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - createTime = property.Value.GetDateTimeOffset("O"); + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("time"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("addedByCommunicationIdentifier"u8)) { - transactionId = property.Value.GetString(); + addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("participantAdded"u8)) { - threadId = property.Value.GetString(); + participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatParticipantAddedToThreadWithUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, time, @@ -150,10 +157,13 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC participantAdded); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -163,15 +173,20 @@ BinaryData IPersistableModel.W } } - AcsChatParticipantAddedToThreadWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatParticipantAddedToThreadWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatParticipantAddedToThreadWithUserEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement, options); } default: @@ -179,35 +194,28 @@ AcsChatParticipantAddedToThreadWithUserEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatParticipantAddedToThreadWithUserEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatParticipantAddedToThreadWithUserEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatParticipantAddedToThreadWithUserEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatParticipantAddedToThreadWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs index b0d721b171d2..0a981d8e1671 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs @@ -18,14 +18,8 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : AcsChatT /// The chat thread id. /// The communication identifier of the user who added the user. /// The details of the user who was added. - /// , , or is null. internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); - Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -34,28 +28,25 @@ internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifie /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. - internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } - /// Initializes a new instance of for deserialization. - internal AcsChatParticipantAddedToThreadWithUserEventData() - { - } - /// The time at which the user was added to the thread. public DateTimeOffset? Time { get; } + /// The communication identifier of the user who added the user. public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } + /// The details of the user who was added. public AcsChatThreadParticipantProperties ParticipantAdded { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs index baab5f92ad95..20c76a2e16fc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event. [JsonConverter(typeof(AcsChatParticipantRemovedFromThreadEventDataConverter))] - public partial class AcsChatParticipantRemovedFromThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatParticipantRemovedFromThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatParticipantRemovedFromThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Time)) { @@ -53,94 +57,100 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatParticipantRemovedFromThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatParticipantRemovedFromThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatParticipantRemovedFromThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement, options); } - internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatParticipantRemovedFromThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatParticipantRemovedFromThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("time"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - time = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("removedByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantRemoved"u8)) + if (prop.NameEquals("threadId"u8)) { - participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("time"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + time = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("removedByCommunicationIdentifier"u8)) { - transactionId = property.Value.GetString(); + removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("participantRemoved"u8)) { - threadId = property.Value.GetString(); + participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(prop.Value, options); + continue; + } + if (prop.NameEquals("version"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatParticipantRemovedFromThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, time, removedByCommunicationIdentifier, participantRemoved, version); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -150,15 +160,20 @@ BinaryData IPersistableModel.Write } } - AcsChatParticipantRemovedFromThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatParticipantRemovedFromThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatParticipantRemovedFromThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement, options); } default: @@ -166,35 +181,28 @@ AcsChatParticipantRemovedFromThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatParticipantRemovedFromThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatParticipantRemovedFromThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatParticipantRemovedFromThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatParticipantRemovedFromThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs index d3a868a5ed45..7dab89500999 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs @@ -17,13 +17,8 @@ public partial class AcsChatParticipantRemovedFromThreadEventData : AcsChatEvent /// The chat thread id. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. - /// , or is null. internal AcsChatParticipantRemovedFromThreadEventData(string threadId, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); - Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -31,12 +26,12 @@ internal AcsChatParticipantRemovedFromThreadEventData(string threadId, Communica /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// The version of the thread. - internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, additionalBinaryDataProperties) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -44,17 +39,15 @@ internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, stri Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatParticipantRemovedFromThreadEventData() - { - } - /// The time at which the user was removed to the thread. public DateTimeOffset? Time { get; } + /// The communication identifier of the user who removed the user. public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } + /// The details of the user who was removed. public AcsChatThreadParticipantProperties ParticipantRemoved { get; } + /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs index ee713a8413b6..5793941b0b2c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. [JsonConverter(typeof(AcsChatParticipantRemovedFromThreadWithUserEventDataConverter))] - public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatParticipantRemovedFromThreadWithUserEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8 /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadWithUserEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Time)) { @@ -48,101 +52,104 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(ParticipantRemoved, options); } - AcsChatParticipantRemovedFromThreadWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatParticipantRemovedFromThreadWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatParticipantRemovedFromThreadWithUserEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadWithUserEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement, options); } - internal static AcsChatParticipantRemovedFromThreadWithUserEventData DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatParticipantRemovedFromThreadWithUserEventData DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? time = default; - CommunicationIdentifierModel removedByCommunicationIdentifier = default; - AcsChatThreadParticipantProperties participantRemoved = default; - DateTimeOffset? createTime = default; - long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + DateTimeOffset? time = default; + CommunicationIdentifierModel removedByCommunicationIdentifier = default; + AcsChatThreadParticipantProperties participantRemoved = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("time"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - time = property.Value.GetDateTimeOffset("O"); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("removedByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("participantRemoved"u8)) + if (prop.NameEquals("threadId"u8)) { - participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("createTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - createTime = property.Value.GetDateTimeOffset("O"); + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("time"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("removedByCommunicationIdentifier"u8)) { - transactionId = property.Value.GetString(); + removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("participantRemoved"u8)) { - threadId = property.Value.GetString(); + participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatParticipantRemovedFromThreadWithUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, time, @@ -150,10 +157,13 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize participantRemoved); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -163,15 +173,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatParticipantRemovedFromThreadWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatParticipantRemovedFromThreadWithUserEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement, options); } default: @@ -179,35 +194,28 @@ AcsChatParticipantRemovedFromThreadWithUserEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatParticipantRemovedFromThreadWithUserEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatParticipantRemovedFromThreadWithUserEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatParticipantRemovedFromThreadWithUserEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatParticipantRemovedFromThreadWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs index 5704886c204e..4efdb88275f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs @@ -18,14 +18,8 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : AcsC /// The chat thread id. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. - /// , , or is null. internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); - Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -34,28 +28,25 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdent /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. - internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } - /// Initializes a new instance of for deserialization. - internal AcsChatParticipantRemovedFromThreadWithUserEventData() - { - } - /// The time at which the user was removed to the thread. public DateTimeOffset? Time { get; } + /// The communication identifier of the user who removed the user. public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } + /// The details of the user who was removed. public AcsChatThreadParticipantProperties ParticipantRemoved { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs index 040ee42aedfe..6acfc580a3d6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event. [JsonConverter(typeof(AcsChatThreadCreatedEventDataConverter))] - public partial class AcsChatThreadCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatThreadCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadCreatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("createdByCommunicationIdentifier"u8); writer.WriteObjectValue(CreatedByCommunicationIdentifier, options); @@ -59,6 +63,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -67,7 +76,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("participants"u8); writer.WriteStartArray(); - foreach (var item in Participants) + foreach (AcsChatThreadParticipantProperties item in Participants) { writer.WriteObjectValue(item, options); } @@ -75,122 +84,132 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatThreadCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadCreatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadCreatedEventData(document.RootElement, options); } - internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; CommunicationIdentifierModel createdByCommunicationIdentifier = default; IReadOnlyDictionary properties = default; - IReadOnlyDictionary metadata = default; + IDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset? createTime = default; - long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("createdByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) + { + transactionId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("threadId"u8)) + { + threadId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("createTime"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createTime = prop.Value.GetDateTimeOffset("O"); + continue; + } + if (prop.NameEquals("version"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); + continue; + } + if (prop.NameEquals("createdByCommunicationIdentifier"u8)) { - createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (prop0.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, null); + dictionary.Add(prop0.Name, null); } else { - dictionary.Add(property0.Name, property0.Value.GetObject()); + dictionary.Add(prop0.Name, prop0.Value.GetObject()); } } properties = dictionary; continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("metadata"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } metadata = dictionary; continue; } - if (property.NameEquals("participants"u8)) + if (prop.NameEquals("participants"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(item, options)); } participants = array; continue; } - if (property.NameEquals("createTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("version"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("transactionId"u8)) - { - transactionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("threadId"u8)) - { - threadId = property.Value.GetString(); - continue; - } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadCreatedEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, createdByCommunicationIdentifier, @@ -199,10 +218,13 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve participants); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -212,15 +234,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AcsChatThreadCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadCreatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadCreatedEventData(document.RootElement, options); } default: @@ -228,35 +255,28 @@ AcsChatThreadCreatedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatThreadCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatThreadCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatThreadCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatThreadCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs index 643230659405..04a6f5e23a1e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs @@ -16,14 +16,9 @@ public partial class AcsChatThreadCreatedEventData : AcsChatThreadEventInThreadB /// Initializes a new instance of . /// The chat thread id. /// The communication identifier of the user who created the thread. - /// The thread properties. - /// , or is null. + /// Gets the properties of the chat thread created event. internal AcsChatThreadCreatedEventData(string threadId, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); - Argument.AssertNotNull(properties, nameof(properties)); - CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; Metadata = new ChangeTrackingDictionary(); @@ -33,14 +28,14 @@ internal AcsChatThreadCreatedEventData(string threadId, CommunicationIdentifierM /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who created the thread. - /// The thread properties. + /// Gets the properties of the chat thread created event. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; @@ -48,15 +43,12 @@ internal AcsChatThreadCreatedEventData(string transactionId, string threadId, ID Participants = participants; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadCreatedEventData() - { - } - /// The communication identifier of the user who created the thread. public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } + /// The thread metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } + /// The list of properties of participants who are part of the thread. public IReadOnlyList Participants { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs index 2ecd1d03bd25..44366ad272e2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event. [JsonConverter(typeof(AcsChatThreadCreatedWithUserEventDataConverter))] - public partial class AcsChatThreadCreatedWithUserEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatThreadCreatedWithUserEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadCreatedWithUserEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadCreatedWithUserEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("createdByCommunicationIdentifier"u8); writer.WriteObjectValue(CreatedByCommunicationIdentifier, options); @@ -59,6 +63,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -67,7 +76,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("participants"u8); writer.WriteStartArray(); - foreach (var item in Participants) + foreach (AcsChatThreadParticipantProperties item in Participants) { writer.WriteObjectValue(item, options); } @@ -75,129 +84,139 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatThreadCreatedWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadCreatedWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadCreatedWithUserEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadCreatedWithUserEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement, options); } - internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCreatedWithUserEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCreatedWithUserEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CommunicationIdentifierModel createdByCommunicationIdentifier = default; - IReadOnlyDictionary properties = default; - IReadOnlyDictionary metadata = default; - IReadOnlyList participants = default; - DateTimeOffset? createTime = default; - long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + CommunicationIdentifierModel createdByCommunicationIdentifier = default; + IReadOnlyDictionary properties = default; + IDictionary metadata = default; + IReadOnlyList participants = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("createdByCommunicationIdentifier"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) + { + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); + continue; + } + if (prop.NameEquals("transactionId"u8)) + { + transactionId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("threadId"u8)) + { + threadId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("createTime"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createTime = prop.Value.GetDateTimeOffset("O"); + continue; + } + if (prop.NameEquals("version"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); + continue; + } + if (prop.NameEquals("createdByCommunicationIdentifier"u8)) { - createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (prop0.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, null); + dictionary.Add(prop0.Name, null); } else { - dictionary.Add(property0.Name, property0.Value.GetObject()); + dictionary.Add(prop0.Name, prop0.Value.GetObject()); } } properties = dictionary; continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("metadata"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } metadata = dictionary; continue; } - if (property.NameEquals("participants"u8)) + if (prop.NameEquals("participants"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(item, options)); } participants = array; continue; } - if (property.NameEquals("createTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("version"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) - { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); - continue; - } - if (property.NameEquals("transactionId"u8)) - { - transactionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("threadId"u8)) - { - threadId = property.Value.GetString(); - continue; - } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadCreatedWithUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, createdByCommunicationIdentifier, @@ -206,10 +225,13 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr participants); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -219,15 +241,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsChatThreadCreatedWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadCreatedWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadCreatedWithUserEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement, options); } default: @@ -235,35 +262,28 @@ AcsChatThreadCreatedWithUserEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadCreatedWithUserEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatThreadCreatedWithUserEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatThreadCreatedWithUserEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatThreadCreatedWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs index a501eda63af8..4007890cdf8b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs @@ -17,15 +17,9 @@ public partial class AcsChatThreadCreatedWithUserEventData : AcsChatThreadEventB /// The communication identifier of the target user. /// The chat thread id. /// The communication identifier of the user who created the thread. - /// The thread properties. - /// , , or is null. + /// Gets the properties of the chat thread created with user event. internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); - Argument.AssertNotNull(properties, nameof(properties)); - CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; Metadata = new ChangeTrackingDictionary(); @@ -36,14 +30,14 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who created the thread. - /// The thread properties. + /// Gets the properties of the chat thread created with user event. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; @@ -51,15 +45,12 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci Participants = participants; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadCreatedWithUserEventData() - { - } - /// The communication identifier of the user who created the thread. public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } + /// The thread metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } + /// The list of properties of participants who are part of the thread. public IReadOnlyList Participants { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs index 8ae23b8de65b..0eaf48a2ee39 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event. [JsonConverter(typeof(AcsChatThreadDeletedEventDataConverter))] - public partial class AcsChatThreadDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatThreadDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); @@ -46,98 +50,104 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatThreadDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadDeletedEventData(document.RootElement, options); } - internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset? deleteTime = default; - DateTimeOffset? createTime = default; - long? version = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + CommunicationIdentifierModel deletedByCommunicationIdentifier = default; + DateTimeOffset? deleteTime = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deletedByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("deleteTime"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - deleteTime = property.Value.GetDateTimeOffset("O"); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("createTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - createTime = property.Value.GetDateTimeOffset("O"); + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("deletedByCommunicationIdentifier"u8)) { - transactionId = property.Value.GetString(); + deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("deleteTime"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadDeletedEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, deletedByCommunicationIdentifier, deleteTime); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -147,15 +157,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AcsChatThreadDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadDeletedEventData(document.RootElement, options); } default: @@ -163,35 +178,28 @@ AcsChatThreadDeletedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatThreadDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatThreadDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatThreadDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatThreadDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs index f9e29fda778e..7abf04e1170b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs @@ -16,36 +16,28 @@ public partial class AcsChatThreadDeletedEventData : AcsChatThreadEventInThreadB /// Initializes a new instance of . /// The chat thread id. /// The communication identifier of the user who deleted the thread. - /// or is null. internal AcsChatThreadDeletedEventData(string threadId, CommunicationIdentifierModel deletedByCommunicationIdentifier) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); - DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; } /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal AcsChatThreadDeletedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadDeletedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadDeletedEventData() - { - } - /// The communication identifier of the user who deleted the thread. public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } + /// The deletion time of the thread. public DateTimeOffset? DeleteTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs index 1037aa3ac19f..1434fa386b38 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatThreadEventBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all chat thread events. + public partial class AcsChatThreadEventBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadEventBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadEventBaseProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(CreateTime)) { @@ -47,87 +51,93 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatThreadEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadEventBaseProperties)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadEventBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadEventBaseProperties(document.RootElement, options); } - internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? createTime = default; - long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createTime = property.Value.GetDateTimeOffset("O"); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("transactionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("threadId"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("createTime"u8)) { - transactionId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("version"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadEventBaseProperties( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -137,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - AcsChatThreadEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadEventBaseProperties)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadEventBaseProperties(document.RootElement, options); } default: @@ -153,22 +168,7 @@ AcsChatThreadEventBaseProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadEventBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadEventBaseProperties(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs index 5739999e6d8d..ecf5d3de0673 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs @@ -16,33 +16,26 @@ public partial class AcsChatThreadEventBaseProperties : AcsChatEventBaseProperti /// Initializes a new instance of . /// The communication identifier of the target user. /// The chat thread id. - /// or is null. internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); } /// Initializes a new instance of . /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. - internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties) { CreateTime = createTime; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadEventBaseProperties() - { - } - /// The original creation time of the thread. public DateTimeOffset? CreateTime { get; } + /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs index 9db30e0d617e..fe9c711144f3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatThreadEventInThreadBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all chat thread events. + public partial class AcsChatThreadEventInThreadBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadEventInThreadBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadEventInThreadBaseProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(CreateTime)) { @@ -47,75 +51,81 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatThreadEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadEventInThreadBaseProperties)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadEventInThreadBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadEventInThreadBaseProperties(document.RootElement, options); } - internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThreadEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThreadEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? createTime = default; - long? version = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("transactionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createTime = property.Value.GetDateTimeOffset("O"); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - version = property.Value.GetInt64(); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("createTime"u8)) { - transactionId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("version"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData, createTime, version); + return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, additionalBinaryDataProperties, createTime, version); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -125,15 +135,20 @@ BinaryData IPersistableModel.Write(Mod } } - AcsChatThreadEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadEventInThreadBaseProperties)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadEventInThreadBaseProperties(document.RootElement, options); } default: @@ -141,22 +156,7 @@ AcsChatThreadEventInThreadBaseProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadEventInThreadBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadEventInThreadBaseProperties(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs index 95741434979f..eddcb53a8be0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs @@ -15,31 +15,25 @@ public partial class AcsChatThreadEventInThreadBaseProperties : AcsChatEventInTh { /// Initializes a new instance of . /// The chat thread id. - /// is null. internal AcsChatThreadEventInThreadBaseProperties(string threadId) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); } /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. - internal AcsChatThreadEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatThreadEventInThreadBaseProperties(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version) : base(transactionId, threadId, additionalBinaryDataProperties) { CreateTime = createTime; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadEventInThreadBaseProperties() - { - } - /// The original creation time of the thread. public DateTimeOffset? CreateTime { get; } + /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs index 2c1c21d70f17..fc06f2862365 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsChatThreadParticipantProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of the chat thread participant. + public partial class AcsChatThreadParticipantProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadParticipantProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadParticipantProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(DisplayName)) { writer.WritePropertyName("displayName"u8); @@ -48,19 +52,24 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,70 +78,83 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsChatThreadParticipantProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadParticipantProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsChatThreadParticipantProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadParticipantProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadParticipantProperties(document.RootElement, options); } - internal static AcsChatThreadParticipantProperties DeserializeAcsChatThreadParticipantProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadParticipantProperties DeserializeAcsChatThreadParticipantProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string displayName = default; CommunicationIdentifierModel participantCommunicationIdentifier = default; - IReadOnlyDictionary metadata = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary metadata = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("displayName"u8)) + if (prop.NameEquals("displayName"u8)) { - displayName = property.Value.GetString(); + displayName = prop.Value.GetString(); continue; } - if (property.NameEquals("participantCommunicationIdentifier"u8)) + if (prop.NameEquals("participantCommunicationIdentifier"u8)) { - participantCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + participantCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("metadata"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } metadata = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsChatThreadParticipantProperties(displayName, participantCommunicationIdentifier, metadata ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new AcsChatThreadParticipantProperties(displayName, participantCommunicationIdentifier, metadata ?? new ChangeTrackingDictionary(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -142,15 +164,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - AcsChatThreadParticipantProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadParticipantProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsChatThreadParticipantProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadParticipantProperties(document.RootElement, options); } default: @@ -158,22 +185,7 @@ AcsChatThreadParticipantProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsChatThreadParticipantProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadParticipantProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs index 5022f028e4ed..b1f8a4d99350 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the chat thread participant. public partial class AcsChatThreadParticipantProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The communication identifier of the user. - /// is null. internal AcsChatThreadParticipantProperties(CommunicationIdentifierModel participantCommunicationIdentifier) { - Argument.AssertNotNull(participantCommunicationIdentifier, nameof(participantCommunicationIdentifier)); - ParticipantCommunicationIdentifier = participantCommunicationIdentifier; Metadata = new ChangeTrackingDictionary(); } @@ -60,25 +28,22 @@ internal AcsChatThreadParticipantProperties(CommunicationIdentifierModel partici /// The name of the user. /// The communication identifier of the user. /// The metadata of the user. - /// Keeps track of any properties unknown to the library. - internal AcsChatThreadParticipantProperties(string displayName, CommunicationIdentifierModel participantCommunicationIdentifier, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsChatThreadParticipantProperties(string displayName, CommunicationIdentifierModel participantCommunicationIdentifier, IDictionary metadata, IDictionary additionalBinaryDataProperties) { DisplayName = displayName; ParticipantCommunicationIdentifier = participantCommunicationIdentifier; Metadata = metadata; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsChatThreadParticipantProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the user. public string DisplayName { get; } + /// The communication identifier of the user. public CommunicationIdentifierModel ParticipantCommunicationIdentifier { get; } + /// The metadata of the user. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs index 463e3d1fcac5..3a1c6a561da1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event. [JsonConverter(typeof(AcsChatThreadPropertiesUpdatedEventDataConverter))] - public partial class AcsChatThreadPropertiesUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatThreadPropertiesUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadPropertiesUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadPropertiesUpdatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); @@ -62,122 +66,137 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - AcsChatThreadPropertiesUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadPropertiesUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadPropertiesUpdatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadPropertiesUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadPropertiesUpdatedEventData(document.RootElement, options); } - internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThreadPropertiesUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThreadPropertiesUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; CommunicationIdentifierModel editedByCommunicationIdentifier = default; DateTimeOffset? editTime = default; IReadOnlyDictionary properties = default; - IReadOnlyDictionary metadata = default; - DateTimeOffset? createTime = default; - long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary metadata = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("editedByCommunicationIdentifier"u8)) + if (prop.NameEquals("transactionId"u8)) { - editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("editTime"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - editTime = property.Value.GetDateTimeOffset("O"); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("createTime"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + if (prop.Value.ValueKind == JsonValueKind.Null) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property0.Name, null); - } - else - { - dictionary.Add(property0.Name, property0.Value.GetObject()); - } + continue; } - properties = dictionary; + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("version"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + if (prop.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, property0.Value.GetString()); + continue; } - metadata = dictionary; + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("editedByCommunicationIdentifier"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createTime = property.Value.GetDateTimeOffset("O"); + editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("editTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + editTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("properties"u8)) { - transactionId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetObject()); + } + } + properties = dictionary; continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("metadata"u8)) { - threadId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadPropertiesUpdatedEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, editedByCommunicationIdentifier, @@ -186,10 +205,13 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread metadata); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -199,15 +221,20 @@ BinaryData IPersistableModel.Write(Mode } } - AcsChatThreadPropertiesUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadPropertiesUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadPropertiesUpdatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadPropertiesUpdatedEventData(document.RootElement, options); } default: @@ -215,35 +242,28 @@ AcsChatThreadPropertiesUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadPropertiesUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadPropertiesUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatThreadPropertiesUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatThreadPropertiesUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatThreadPropertiesUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatThreadPropertiesUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadPropertiesUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs index 461ca1a8cf61..143e2718670f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs @@ -16,16 +16,10 @@ public partial class AcsChatThreadPropertiesUpdatedEventData : AcsChatThreadEven /// Initializes a new instance of . /// The chat thread id. /// The communication identifier of the user who updated the thread properties. - /// The updated thread properties. + /// Gets the properties of the chat thread updated event. /// The thread metadata. - /// , , or is null. - internal AcsChatThreadPropertiesUpdatedEventData(string threadId, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(threadId) + internal AcsChatThreadPropertiesUpdatedEventData(string threadId, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties, IDictionary metadata) : base(threadId) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); - Argument.AssertNotNull(properties, nameof(properties)); - Argument.AssertNotNull(metadata, nameof(metadata)); - EditedByCommunicationIdentifier = editedByCommunicationIdentifier; Properties = properties; Metadata = metadata; @@ -34,14 +28,14 @@ internal AcsChatThreadPropertiesUpdatedEventData(string threadId, CommunicationI /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who updated the thread properties. /// The time at which the properties of the thread were updated. - /// The updated thread properties. + /// Gets the properties of the chat thread updated event. /// The thread metadata. - internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -49,16 +43,13 @@ internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string th Metadata = metadata; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadPropertiesUpdatedEventData() - { - } - /// The communication identifier of the user who updated the thread properties. public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } + /// The time at which the properties of the thread were updated. public DateTimeOffset? EditTime { get; } + /// The thread metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs index 834d48f217db..61c6a20a4b71 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. [JsonConverter(typeof(AcsChatThreadPropertiesUpdatedPerUserEventDataConverter))] - public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadPropertiesUpdatedPerUserEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadPropertiesUpdatedPerUserEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); @@ -51,6 +55,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -70,128 +79,138 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - AcsChatThreadPropertiesUpdatedPerUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadPropertiesUpdatedPerUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadPropertiesUpdatedPerUserEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadPropertiesUpdatedPerUserEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement, options); } - internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset? editTime = default; - IReadOnlyDictionary metadata = default; - IReadOnlyDictionary properties = default; - DateTimeOffset? createTime = default; - long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + CommunicationIdentifierModel editedByCommunicationIdentifier = default; + DateTimeOffset? editTime = default; + IDictionary metadata = default; + IReadOnlyDictionary properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("editedByCommunicationIdentifier"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) + { + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); + continue; + } + if (prop.NameEquals("transactionId"u8)) { - editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("editTime"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + threadId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("createTime"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - editTime = property.Value.GetDateTimeOffset("O"); + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("editedByCommunicationIdentifier"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property0.Name, null); - } - else - { - dictionary.Add(property0.Name, property0.Value.GetObject()); - } - } - properties = dictionary; + editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("editTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - createTime = property.Value.GetDateTimeOffset("O"); + editTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("metadata"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) - { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); - continue; - } - if (property.NameEquals("transactionId"u8)) - { - transactionId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("properties"u8)) { - threadId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetObject()); + } + } + properties = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadPropertiesUpdatedPerUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, editedByCommunicationIdentifier, @@ -200,10 +219,13 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha properties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -213,15 +235,20 @@ BinaryData IPersistableModel.Wri } } - AcsChatThreadPropertiesUpdatedPerUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadPropertiesUpdatedPerUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadPropertiesUpdatedPerUserEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement, options); } default: @@ -229,35 +256,28 @@ AcsChatThreadPropertiesUpdatedPerUserEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadPropertiesUpdatedPerUserEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatThreadPropertiesUpdatedPerUserEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatThreadPropertiesUpdatedPerUserEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatThreadPropertiesUpdatedPerUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs index b106efa7e500..20b5a38f1b2a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -17,15 +17,9 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : AcsChatThr /// The communication identifier of the target user. /// The chat thread id. /// The communication identifier of the user who updated the thread properties. - /// The updated thread properties. - /// , , or is null. + /// The properties of the chat thread that were updated for the user. internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); - Argument.AssertNotNull(properties, nameof(properties)); - EditedByCommunicationIdentifier = editedByCommunicationIdentifier; Metadata = new ChangeTrackingDictionary(); Properties = properties; @@ -35,14 +29,14 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who updated the thread properties. /// The time at which the properties of the thread were updated. /// The thread metadata. - /// The updated thread properties. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + /// The properties of the chat thread that were updated for the user. + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -50,16 +44,13 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM Properties = properties; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadPropertiesUpdatedPerUserEventData() - { - } - /// The communication identifier of the user who updated the thread properties. public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } + /// The time at which the properties of the thread were updated. public DateTimeOffset? EditTime { get; } + /// The thread metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs index b78e39a87f2a..80ad31bbc4ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event. [JsonConverter(typeof(AcsChatThreadWithUserDeletedEventDataConverter))] - public partial class AcsChatThreadWithUserDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatThreadWithUserDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatThreadWithUserDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadWithUserDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); @@ -46,105 +50,111 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsChatThreadWithUserDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatThreadWithUserDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatThreadWithUserDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatThreadWithUserDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement, options); } - internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWithUserDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWithUserDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset? deleteTime = default; - DateTimeOffset? createTime = default; - long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + DateTimeOffset? createTime = default; + long? version = default; + CommunicationIdentifierModel deletedByCommunicationIdentifier = default; + DateTimeOffset? deleteTime = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deletedByCommunicationIdentifier"u8)) + if (prop.NameEquals("recipientCommunicationIdentifier"u8)) { - deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("deleteTime"u8)) + if (prop.NameEquals("transactionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - deleteTime = property.Value.GetDateTimeOffset("O"); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("createTime"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createTime = property.Value.GetDateTimeOffset("O"); + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("createTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + createTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("recipientCommunicationIdentifier"u8)) + if (prop.NameEquals("version"u8)) { - recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("deletedByCommunicationIdentifier"u8)) { - transactionId = property.Value.GetString(); + deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("deleteTime"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatThreadWithUserDeletedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, createTime, version, deletedByCommunicationIdentifier, deleteTime); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -154,15 +164,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsChatThreadWithUserDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatThreadWithUserDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatThreadWithUserDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement, options); } default: @@ -170,35 +185,28 @@ AcsChatThreadWithUserDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatThreadWithUserDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatThreadWithUserDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatThreadWithUserDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatThreadWithUserDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs index 54c3055e2f19..47a14ef820c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs @@ -17,13 +17,8 @@ public partial class AcsChatThreadWithUserDeletedEventData : AcsChatThreadEventB /// The communication identifier of the target user. /// The chat thread id. /// The communication identifier of the user who deleted the thread. - /// , or is null. internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string threadId, CommunicationIdentifierModel deletedByCommunicationIdentifier) : base(recipientCommunicationIdentifier, threadId) { - Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); - DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; } @@ -31,24 +26,20 @@ internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel reci /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadWithUserDeletedEventData() - { - } - /// The communication identifier of the user who deleted the thread. public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } + /// The deletion time of the thread. public DateTimeOffset? DeleteTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs index afed5b6434a6..54996d0b2a7b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatTypingIndicatorReceivedInThread event. [JsonConverter(typeof(AcsChatTypingIndicatorReceivedInThreadEventDataConverter))] - public partial class AcsChatTypingIndicatorReceivedInThreadEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsChatTypingIndicatorReceivedInThreadEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsChatTypingIndicatorReceivedInThreadEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatTypingIndicatorReceivedInThreadEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); @@ -46,137 +50,155 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Metadata) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } } - AcsChatTypingIndicatorReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsChatTypingIndicatorReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsChatTypingIndicatorReceivedInThreadEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsChatTypingIndicatorReceivedInThreadEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(document.RootElement, options); } - internal static AcsChatTypingIndicatorReceivedInThreadEventData DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsChatTypingIndicatorReceivedInThreadEventData DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageBody = default; - IReadOnlyDictionary metadata = default; + string transactionId = default; + string threadId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; DateTimeOffset? composeTime = default; - string type = default; + string @type = default; long? version = default; - string transactionId = default; - string threadId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageBody = default; + IDictionary metadata = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageBody"u8)) + if (prop.NameEquals("transactionId"u8)) { - messageBody = property.Value.GetString(); + transactionId = prop.Value.GetString(); continue; } - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("threadId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - metadata = dictionary; + threadId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("senderCommunicationIdentifier"u8)) + if (prop.NameEquals("senderCommunicationIdentifier"u8)) { - senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("senderDisplayName"u8)) + if (prop.NameEquals("senderDisplayName"u8)) { - senderDisplayName = property.Value.GetString(); + senderDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("composeTime"u8)) + if (prop.NameEquals("composeTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - composeTime = property.Value.GetDateTimeOffset("O"); + composeTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetInt64(); + version = prop.Value.GetInt64(); continue; } - if (property.NameEquals("transactionId"u8)) + if (prop.NameEquals("messageBody"u8)) { - transactionId = property.Value.GetString(); + messageBody = prop.Value.GetString(); continue; } - if (property.NameEquals("threadId"u8)) + if (prop.NameEquals("metadata"u8)) { - threadId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + metadata = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsChatTypingIndicatorReceivedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData, + additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata ?? new ChangeTrackingDictionary()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -186,15 +208,20 @@ BinaryData IPersistableModel.Wr } } - AcsChatTypingIndicatorReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsChatTypingIndicatorReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsChatTypingIndicatorReceivedInThreadEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsChatEventInThreadBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(document.RootElement, options); } default: @@ -202,35 +229,28 @@ AcsChatTypingIndicatorReceivedInThreadEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsChatTypingIndicatorReceivedInThreadEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsChatTypingIndicatorReceivedInThreadEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsChatTypingIndicatorReceivedInThreadEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsChatTypingIndicatorReceivedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatTypingIndicatorReceivedInThreadEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs index 7fad227103aa..518b3ebc07ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs @@ -19,15 +19,8 @@ public partial class AcsChatTypingIndicatorReceivedInThreadEventData : AcsChatMe /// The communication identifier of the sender. /// The type of the message. /// The body of the chat message. - /// , , , or is null. - internal AcsChatTypingIndicatorReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, type) + internal AcsChatTypingIndicatorReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string @type, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, @type) { - Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - Argument.AssertNotNull(type, nameof(type)); - Argument.AssertNotNull(messageBody, nameof(messageBody)); - MessageBody = messageBody; Metadata = new ChangeTrackingDictionary(); } @@ -35,7 +28,7 @@ internal AcsChatTypingIndicatorReceivedInThreadEventData(string threadId, string /// Initializes a new instance of . /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The chat message id. /// The communication identifier of the sender. /// The display name of the sender. @@ -44,20 +37,16 @@ internal AcsChatTypingIndicatorReceivedInThreadEventData(string threadId, string /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; } - /// Initializes a new instance of for deserialization. - internal AcsChatTypingIndicatorReceivedInThreadEventData() - { - } - /// The body of the chat message. public string MessageBody { get; } + /// The chat message metadata. - public IReadOnlyDictionary Metadata { get; } + public IDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCommunicationIdentifierKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCommunicationIdentifierKind.cs index c7e3ad4799bc..2a983c128edc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCommunicationIdentifierKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsCommunicationIdentifierKind.cs @@ -14,47 +14,72 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsCommunicationIdentifierKind : IEquatable { private readonly string _value; + /// Unknown. + private const string UnknownValue = "unknown"; + /// Communication User. + private const string CommunicationUserValue = "communicationUser"; + /// Phone Number. + private const string PhoneNumberValue = "phoneNumber"; + /// Microsoft Teams User. + private const string MicrosoftTeamsUserValue = "microsoftTeamsUser"; + /// Microsoft Teams App. + private const string MicrosoftTeamsAppValue = "microsoftTeamsApp"; /// Initializes a new instance of . + /// The value. /// is null. public AcsCommunicationIdentifierKind(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string UnknownValue = "unknown"; - private const string CommunicationUserValue = "communicationUser"; - private const string PhoneNumberValue = "phoneNumber"; - private const string MicrosoftTeamsUserValue = "microsoftTeamsUser"; - private const string MicrosoftTeamsAppValue = "microsoftTeamsApp"; + _value = value; + } /// Unknown. public static AcsCommunicationIdentifierKind Unknown { get; } = new AcsCommunicationIdentifierKind(UnknownValue); + /// Communication User. public static AcsCommunicationIdentifierKind CommunicationUser { get; } = new AcsCommunicationIdentifierKind(CommunicationUserValue); + /// Phone Number. public static AcsCommunicationIdentifierKind PhoneNumber { get; } = new AcsCommunicationIdentifierKind(PhoneNumberValue); + /// Microsoft Teams User. public static AcsCommunicationIdentifierKind MicrosoftTeamsUser { get; } = new AcsCommunicationIdentifierKind(MicrosoftTeamsUserValue); + /// Microsoft Teams App. public static AcsCommunicationIdentifierKind MicrosoftTeamsApp { get; } = new AcsCommunicationIdentifierKind(MicrosoftTeamsAppValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsCommunicationIdentifierKind left, AcsCommunicationIdentifierKind right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsCommunicationIdentifierKind left, AcsCommunicationIdentifierKind right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsCommunicationIdentifierKind(string value) => new AcsCommunicationIdentifierKind(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsCommunicationIdentifierKind?(string value) => value == null ? null : new AcsCommunicationIdentifierKind(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsCommunicationIdentifierKind other && Equals(other); - /// + + /// public bool Equals(AcsCommunicationIdentifierKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs index 0c6121fbfdcd..52360e0993b8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailDeliveryReportReceived event. [JsonConverter(typeof(AcsEmailDeliveryReportReceivedEventDataConverter))] - public partial class AcsEmailDeliveryReportReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsEmailDeliveryReportReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsEmailDeliveryReportReceivedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsEmailDeliveryReportReceivedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("sender"u8); writer.WriteStringValue(Sender); writer.WritePropertyName("recipient"u8); @@ -59,15 +63,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("deliveryAttemptTimestamp"u8); writer.WriteStringValue(DeliveryAttemptTimestamp.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -76,22 +80,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsEmailDeliveryReportReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsEmailDeliveryReportReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsEmailDeliveryReportReceivedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsEmailDeliveryReportReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsEmailDeliveryReportReceivedEventData(document.RootElement, options); } - internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliveryReportReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliveryReportReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -103,59 +112,57 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv AcsEmailDeliveryReportStatus? status = default; AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = default; DateTimeOffset? deliveryAttemptTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sender"u8)) + if (prop.NameEquals("sender"u8)) { - sender = property.Value.GetString(); + sender = prop.Value.GetString(); continue; } - if (property.NameEquals("recipient"u8)) + if (prop.NameEquals("recipient"u8)) { - recipient = property.Value.GetString(); + recipient = prop.Value.GetString(); continue; } - if (property.NameEquals("internetMessageId"u8)) + if (prop.NameEquals("internetMessageId"u8)) { - internetMessageId = property.Value.GetString(); + internetMessageId = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new AcsEmailDeliveryReportStatus(property.Value.GetString()); + status = new AcsEmailDeliveryReportStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("deliveryStatusDetails"u8)) + if (prop.NameEquals("deliveryStatusDetails"u8)) { - deliveryStatusDetails = AcsEmailDeliveryReportStatusDetails.DeserializeAcsEmailDeliveryReportStatusDetails(property.Value, options); + deliveryStatusDetails = AcsEmailDeliveryReportStatusDetails.DeserializeAcsEmailDeliveryReportStatusDetails(prop.Value, options); continue; } - if (property.NameEquals("deliveryAttemptTimestamp"u8)) + if (prop.NameEquals("deliveryAttemptTimestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - deliveryAttemptTimestamp = property.Value.GetDateTimeOffset("O"); + deliveryAttemptTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsEmailDeliveryReportReceivedEventData( sender, recipient, @@ -164,13 +171,16 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv status, deliveryStatusDetails, deliveryAttemptTimestamp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -180,15 +190,20 @@ BinaryData IPersistableModel.Write(Mode } } - AcsEmailDeliveryReportReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsEmailDeliveryReportReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsEmailDeliveryReportReceivedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsEmailDeliveryReportReceivedEventData(document.RootElement, options); } default: @@ -196,35 +211,28 @@ AcsEmailDeliveryReportReceivedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsEmailDeliveryReportReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsEmailDeliveryReportReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsEmailDeliveryReportReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsEmailDeliveryReportReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsEmailDeliveryReportReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsEmailDeliveryReportReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsEmailDeliveryReportReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs index 291989fd56e3..3b2c6165fc9d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs @@ -13,51 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailDeliveryReportReceived event. public partial class AcsEmailDeliveryReportReceivedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Sender Email Address. /// The recipient Email Address. /// The Internet Message Id of the email that has been sent. /// Detailed information about the status if any. - /// , , or is null. internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string internetMessageId, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails) { - Argument.AssertNotNull(sender, nameof(sender)); - Argument.AssertNotNull(recipient, nameof(recipient)); - Argument.AssertNotNull(internetMessageId, nameof(internetMessageId)); - Argument.AssertNotNull(deliveryStatusDetails, nameof(deliveryStatusDetails)); - Sender = sender; Recipient = recipient; InternetMessageId = internetMessageId; @@ -72,8 +37,8 @@ internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient /// The status of the email. Any value other than Delivered is considered failed. /// Detailed information about the status if any. /// The time at which the email delivery report received timestamp. - /// Keeps track of any properties unknown to the library. - internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string internetMessageId, string messageId, AcsEmailDeliveryReportStatus? status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset? deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string internetMessageId, string messageId, AcsEmailDeliveryReportStatus? status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset? deliveryAttemptTimestamp, IDictionary additionalBinaryDataProperties) { Sender = sender; Recipient = recipient; @@ -82,26 +47,27 @@ internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient Status = status; DeliveryStatusDetails = deliveryStatusDetails; DeliveryAttemptTimestamp = deliveryAttemptTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsEmailDeliveryReportReceivedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Sender Email Address. public string Sender { get; } + /// The recipient Email Address. public string Recipient { get; } + /// The Internet Message Id of the email that has been sent. public string InternetMessageId { get; } + /// The Id of the email that has been sent. public string MessageId { get; } + /// The status of the email. Any value other than Delivered is considered failed. public AcsEmailDeliveryReportStatus? Status { get; } + /// Detailed information about the status if any. public AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get; } + /// The time at which the email delivery report received timestamp. public DateTimeOffset? DeliveryAttemptTimestamp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatus.cs index 116220d30935..76248c68248b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatus.cs @@ -14,50 +14,77 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsEmailDeliveryReportStatus : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AcsEmailDeliveryReportStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// Hard bounce detected while sending the email. private const string BouncedValue = "Bounced"; + /// The email was delivered. private const string DeliveredValue = "Delivered"; + /// The email failed to be delivered. private const string FailedValue = "Failed"; + /// The message was identified as spam and was rejected or blocked (not quarantined). private const string FilteredSpamValue = "FilteredSpam"; + /// The message was quarantined (as spam, bulk mail, or phishing). For more information, see Quarantined email messages in EOP (EXCHANGE ONLINE PROTECTION). private const string QuarantinedValue = "Quarantined"; + /// The email was suppressed. private const string SuppressedValue = "Suppressed"; + /// Initializes a new instance of . + /// The value. + /// is null. + public AcsEmailDeliveryReportStatus(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// Hard bounce detected while sending the email. public static AcsEmailDeliveryReportStatus Bounced { get; } = new AcsEmailDeliveryReportStatus(BouncedValue); + /// The email was delivered. public static AcsEmailDeliveryReportStatus Delivered { get; } = new AcsEmailDeliveryReportStatus(DeliveredValue); + /// The email failed to be delivered. public static AcsEmailDeliveryReportStatus Failed { get; } = new AcsEmailDeliveryReportStatus(FailedValue); + /// The message was identified as spam and was rejected or blocked (not quarantined). public static AcsEmailDeliveryReportStatus FilteredSpam { get; } = new AcsEmailDeliveryReportStatus(FilteredSpamValue); + /// The message was quarantined (as spam, bulk mail, or phishing). For more information, see Quarantined email messages in EOP (EXCHANGE ONLINE PROTECTION). public static AcsEmailDeliveryReportStatus Quarantined { get; } = new AcsEmailDeliveryReportStatus(QuarantinedValue); + /// The email was suppressed. public static AcsEmailDeliveryReportStatus Suppressed { get; } = new AcsEmailDeliveryReportStatus(SuppressedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsEmailDeliveryReportStatus left, AcsEmailDeliveryReportStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsEmailDeliveryReportStatus left, AcsEmailDeliveryReportStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsEmailDeliveryReportStatus(string value) => new AcsEmailDeliveryReportStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsEmailDeliveryReportStatus?(string value) => value == null ? null : new AcsEmailDeliveryReportStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsEmailDeliveryReportStatus other && Equals(other); - /// + + /// public bool Equals(AcsEmailDeliveryReportStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.Serialization.cs index 6127f67f9542..cb0992722e64 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsEmailDeliveryReportStatusDetails : IUtf8JsonSerializable, IJsonModel + /// Detailed information about the status if any. + public partial class AcsEmailDeliveryReportStatusDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsEmailDeliveryReportStatusDetails)} does not support writing '{format}' format."); } - if (Optional.IsDefined(StatusMessage)) { writer.WritePropertyName("statusMessage"u8); @@ -44,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("recipientMailServerHostName"u8); writer.WriteStringValue(RecipientMailServerHostName); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsEmailDeliveryReportStatusDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsEmailDeliveryReportStatusDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsEmailDeliveryReportStatusDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsEmailDeliveryReportStatusDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsEmailDeliveryReportStatusDetails(document.RootElement, options); } - internal static AcsEmailDeliveryReportStatusDetails DeserializeAcsEmailDeliveryReportStatusDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsEmailDeliveryReportStatusDetails DeserializeAcsEmailDeliveryReportStatusDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string statusMessage = default; string recipientMailServerHostName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("statusMessage"u8)) + if (prop.NameEquals("statusMessage"u8)) { - statusMessage = property.Value.GetString(); + statusMessage = prop.Value.GetString(); continue; } - if (property.NameEquals("recipientMailServerHostName"u8)) + if (prop.NameEquals("recipientMailServerHostName"u8)) { - recipientMailServerHostName = property.Value.GetString(); + recipientMailServerHostName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsEmailDeliveryReportStatusDetails(statusMessage, recipientMailServerHostName, serializedAdditionalRawData); + return new AcsEmailDeliveryReportStatusDetails(statusMessage, recipientMailServerHostName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - AcsEmailDeliveryReportStatusDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsEmailDeliveryReportStatusDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsEmailDeliveryReportStatusDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsEmailDeliveryReportStatusDetails(document.RootElement, options); } default: @@ -135,22 +145,7 @@ AcsEmailDeliveryReportStatusDetails IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsEmailDeliveryReportStatusDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsEmailDeliveryReportStatusDetails(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.cs index 752b6b82d633..4aaded2447e5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportStatusDetails.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Detailed information about the status if any. public partial class AcsEmailDeliveryReportStatusDetails { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsEmailDeliveryReportStatusDetails() @@ -53,16 +24,17 @@ internal AcsEmailDeliveryReportStatusDetails() /// Initializes a new instance of . /// Detailed status message. /// Recipient mail server host name. - /// Keeps track of any properties unknown to the library. - internal AcsEmailDeliveryReportStatusDetails(string statusMessage, string recipientMailServerHostName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsEmailDeliveryReportStatusDetails(string statusMessage, string recipientMailServerHostName, IDictionary additionalBinaryDataProperties) { StatusMessage = statusMessage; RecipientMailServerHostName = recipientMailServerHostName; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detailed status message. public string StatusMessage { get; } + /// Recipient mail server host name. public string RecipientMailServerHostName { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs index 4889f334eb4e..e6fd6d3712e0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailEngagementTrackingReportReceived event. [JsonConverter(typeof(AcsEmailEngagementTrackingReportReceivedEventDataConverter))] - public partial class AcsEmailEngagementTrackingReportReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsEmailEngagementTrackingReportReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8Jso /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsEmailEngagementTrackingReportReceivedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Sender)) { writer.WritePropertyName("sender"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("engagementType"u8); writer.WriteStringValue(Engagement.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsEmailEngagementTrackingReportReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsEmailEngagementTrackingReportReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsEmailEngagementTrackingReportReceivedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsEmailEngagementTrackingReportReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsEmailEngagementTrackingReportReceivedEventData(document.RootElement, options); } - internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcsEmailEngagementTrackingReportReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcsEmailEngagementTrackingReportReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -114,60 +118,58 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs DateTimeOffset? userActionTimestamp = default; string engagementContext = default; string userAgent = default; - AcsUserEngagement? engagementType = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + AcsUserEngagement? engagement = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sender"u8)) + if (prop.NameEquals("sender"u8)) { - sender = property.Value.GetString(); + sender = prop.Value.GetString(); continue; } - if (property.NameEquals("recipient"u8)) + if (prop.NameEquals("recipient"u8)) { - recipient = property.Value.GetString(); + recipient = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("userActionTimestamp"u8)) + if (prop.NameEquals("userActionTimestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - userActionTimestamp = property.Value.GetDateTimeOffset("O"); + userActionTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("engagementContext"u8)) + if (prop.NameEquals("engagementContext"u8)) { - engagementContext = property.Value.GetString(); + engagementContext = prop.Value.GetString(); continue; } - if (property.NameEquals("userAgent"u8)) + if (prop.NameEquals("userAgent"u8)) { - userAgent = property.Value.GetString(); + userAgent = prop.Value.GetString(); continue; } - if (property.NameEquals("engagementType"u8)) + if (prop.NameEquals("engagementType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - engagementType = new AcsUserEngagement(property.Value.GetString()); + engagement = new AcsUserEngagement(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsEmailEngagementTrackingReportReceivedEventData( sender, recipient, @@ -175,14 +177,17 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs userActionTimestamp, engagementContext, userAgent, - engagementType, - serializedAdditionalRawData); + engagement, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -192,15 +197,20 @@ BinaryData IPersistableModel. } } - AcsEmailEngagementTrackingReportReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsEmailEngagementTrackingReportReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsEmailEngagementTrackingReportReceivedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsEmailEngagementTrackingReportReceivedEventData(document.RootElement, options); } default: @@ -208,35 +218,28 @@ AcsEmailEngagementTrackingReportReceivedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsEmailEngagementTrackingReportReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsEmailEngagementTrackingReportReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsEmailEngagementTrackingReportReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsEmailEngagementTrackingReportReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsEmailEngagementTrackingReportReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsEmailEngagementTrackingReportReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsEmailEngagementTrackingReportReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs index 78ece94104a5..a268bb3d3121 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailEngagementTrackingReportReceived event. public partial class AcsEmailEngagementTrackingReportReceivedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsEmailEngagementTrackingReportReceivedEventData() @@ -58,8 +29,8 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() /// The context of the type of engagement user had with email. /// The user agent interacting with the email. /// The type of engagement user have with email. - /// Keeps track of any properties unknown to the library. - internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement, IDictionary additionalBinaryDataProperties) { Sender = sender; Recipient = recipient; @@ -68,21 +39,27 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string EngagementContext = engagementContext; UserAgent = userAgent; Engagement = engagement; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Sender Email Address. public string Sender { get; } + /// The Recipient Email Address. public string Recipient { get; } + /// The Id of the email that has been sent. public string MessageId { get; } + /// The time at which the user interacted with the email. public DateTimeOffset? UserActionTimestamp { get; } + /// The context of the type of engagement user had with email. public string EngagementContext { get; } + /// The user agent interacting with the email. public string UserAgent { get; } + /// The type of engagement user have with email. public AcsUserEngagement? Engagement { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs index 7e6b7c841aac..f909868c720b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsIncomingCallCustomContext : IUtf8JsonSerializable, IJsonModel + /// Custom Context of Incoming Call. + public partial class AcsIncomingCallCustomContext : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsIncomingCallCustomContext() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,17 +33,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsIncomingCallCustomContext)} does not support writing '{format}' format."); } - writer.WritePropertyName("sipHeaders"u8); writer.WriteStartObject(); foreach (var item in SipHeaders) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -47,18 +56,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in VoipHeaders) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,65 +81,85 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsIncomingCallCustomContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsIncomingCallCustomContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsIncomingCallCustomContext JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsIncomingCallCustomContext)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsIncomingCallCustomContext(document.RootElement, options); } - internal static AcsIncomingCallCustomContext DeserializeAcsIncomingCallCustomContext(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsIncomingCallCustomContext DeserializeAcsIncomingCallCustomContext(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyDictionary sipHeaders = default; - IReadOnlyDictionary voipHeaders = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary sipHeaders = default; + IDictionary voipHeaders = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sipHeaders"u8)) + if (prop.NameEquals("sipHeaders"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } sipHeaders = dictionary; continue; } - if (property.NameEquals("voipHeaders"u8)) + if (prop.NameEquals("voipHeaders"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } voipHeaders = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsIncomingCallCustomContext(sipHeaders, voipHeaders, serializedAdditionalRawData); + return new AcsIncomingCallCustomContext(sipHeaders, voipHeaders, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -135,15 +169,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - AcsIncomingCallCustomContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsIncomingCallCustomContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsIncomingCallCustomContext PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsIncomingCallCustomContext(document.RootElement, options); } default: @@ -151,22 +190,7 @@ AcsIncomingCallCustomContext IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsIncomingCallCustomContext FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsIncomingCallCustomContext(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs index 56afdcd867fb..a23c81229555 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Custom Context of Incoming Call. public partial class AcsIncomingCallCustomContext { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Sip Headers for incoming call. /// Voip Headers for incoming call. - /// or is null. - internal AcsIncomingCallCustomContext(IReadOnlyDictionary sipHeaders, IReadOnlyDictionary voipHeaders) + internal AcsIncomingCallCustomContext(IDictionary sipHeaders, IDictionary voipHeaders) { - Argument.AssertNotNull(sipHeaders, nameof(sipHeaders)); - Argument.AssertNotNull(voipHeaders, nameof(voipHeaders)); - SipHeaders = sipHeaders; VoipHeaders = voipHeaders; } @@ -61,22 +28,18 @@ internal AcsIncomingCallCustomContext(IReadOnlyDictionary sipHea /// Initializes a new instance of . /// Sip Headers for incoming call. /// Voip Headers for incoming call. - /// Keeps track of any properties unknown to the library. - internal AcsIncomingCallCustomContext(IReadOnlyDictionary sipHeaders, IReadOnlyDictionary voipHeaders, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsIncomingCallCustomContext(IDictionary sipHeaders, IDictionary voipHeaders, IDictionary additionalBinaryDataProperties) { SipHeaders = sipHeaders; VoipHeaders = voipHeaders; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsIncomingCallCustomContext() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Sip Headers for incoming call. - public IReadOnlyDictionary SipHeaders { get; } + public IDictionary SipHeaders { get; } + /// Voip Headers for incoming call. - public IReadOnlyDictionary VoipHeaders { get; } + public IDictionary VoipHeaders { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.Serialization.cs index c2dcc789a8b3..a59b8313b30e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.IncomingCall event. [JsonConverter(typeof(AcsIncomingCallEventDataConverter))] - public partial class AcsIncomingCallEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsIncomingCallEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsIncomingCallEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsIncomingCallEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("to"u8); writer.WriteObjectValue(ToCommunicationIdentifier, options); writer.WritePropertyName("from"u8); @@ -67,15 +71,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("correlationId"u8); writer.WriteStringValue(CorrelationId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -84,104 +88,110 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsIncomingCallEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsIncomingCallEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsIncomingCallEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsIncomingCallEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsIncomingCallEventData(document.RootElement, options); } - internal static AcsIncomingCallEventData DeserializeAcsIncomingCallEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsIncomingCallEventData DeserializeAcsIncomingCallEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CommunicationIdentifierModel to = default; - CommunicationIdentifierModel @from = default; + CommunicationIdentifierModel toCommunicationIdentifier = default; + CommunicationIdentifierModel fromCommunicationIdentifier = default; string serverCallId = default; string callerDisplayName = default; AcsIncomingCallCustomContext customContext = default; string incomingCallContext = default; CommunicationIdentifierModel onBehalfOfCallee = default; string correlationId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("to"u8)) + if (prop.NameEquals("to"u8)) { - to = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + toCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("from"u8)) + if (prop.NameEquals("from"u8)) { - @from = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + fromCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("serverCallId"u8)) + if (prop.NameEquals("serverCallId"u8)) { - serverCallId = property.Value.GetString(); + serverCallId = prop.Value.GetString(); continue; } - if (property.NameEquals("callerDisplayName"u8)) + if (prop.NameEquals("callerDisplayName"u8)) { - callerDisplayName = property.Value.GetString(); + callerDisplayName = prop.Value.GetString(); continue; } - if (property.NameEquals("customContext"u8)) + if (prop.NameEquals("customContext"u8)) { - customContext = AcsIncomingCallCustomContext.DeserializeAcsIncomingCallCustomContext(property.Value, options); + customContext = AcsIncomingCallCustomContext.DeserializeAcsIncomingCallCustomContext(prop.Value, options); continue; } - if (property.NameEquals("incomingCallContext"u8)) + if (prop.NameEquals("incomingCallContext"u8)) { - incomingCallContext = property.Value.GetString(); + incomingCallContext = prop.Value.GetString(); continue; } - if (property.NameEquals("onBehalfOfCallee"u8)) + if (prop.NameEquals("onBehalfOfCallee"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - onBehalfOfCallee = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + onBehalfOfCallee = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsIncomingCallEventData( - to, - @from, + toCommunicationIdentifier, + fromCommunicationIdentifier, serverCallId, callerDisplayName, customContext, incomingCallContext, onBehalfOfCallee, correlationId, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -191,15 +201,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - AcsIncomingCallEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsIncomingCallEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsIncomingCallEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsIncomingCallEventData(document.RootElement, options); } default: @@ -207,35 +222,28 @@ AcsIncomingCallEventData IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsIncomingCallEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsIncomingCallEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsIncomingCallEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsIncomingCallEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsIncomingCallEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsIncomingCallEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsIncomingCallEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.cs index 2a02164d5e87..9013f04b9f69 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.IncomingCall event. public partial class AcsIncomingCallEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the user who initiated the call. /// Custom Context of Incoming Call. - /// , or is null. internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationIdentifier, CommunicationIdentifierModel fromCommunicationIdentifier, AcsIncomingCallCustomContext customContext) { - Argument.AssertNotNull(toCommunicationIdentifier, nameof(toCommunicationIdentifier)); - Argument.AssertNotNull(fromCommunicationIdentifier, nameof(fromCommunicationIdentifier)); - Argument.AssertNotNull(customContext, nameof(customContext)); - ToCommunicationIdentifier = toCommunicationIdentifier; FromCommunicationIdentifier = fromCommunicationIdentifier; CustomContext = customContext; @@ -70,8 +36,8 @@ internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationId /// Signed incoming call context. /// The communication identifier of the user on behalf of whom the call is made. /// CorrelationId (CallId). - /// Keeps track of any properties unknown to the library. - internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationIdentifier, CommunicationIdentifierModel fromCommunicationIdentifier, string serverCallId, string callerDisplayName, AcsIncomingCallCustomContext customContext, string incomingCallContext, CommunicationIdentifierModel onBehalfOfCallee, string correlationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationIdentifier, CommunicationIdentifierModel fromCommunicationIdentifier, string serverCallId, string callerDisplayName, AcsIncomingCallCustomContext customContext, string incomingCallContext, CommunicationIdentifierModel onBehalfOfCallee, string correlationId, IDictionary additionalBinaryDataProperties) { ToCommunicationIdentifier = toCommunicationIdentifier; FromCommunicationIdentifier = fromCommunicationIdentifier; @@ -81,28 +47,30 @@ internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationId IncomingCallContext = incomingCallContext; OnBehalfOfCallee = onBehalfOfCallee; CorrelationId = correlationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsIncomingCallEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The communication identifier of the target user. public CommunicationIdentifierModel ToCommunicationIdentifier { get; } + /// The communication identifier of the user who initiated the call. public CommunicationIdentifierModel FromCommunicationIdentifier { get; } + /// The Id of the server call. public string ServerCallId { get; } + /// Display name of caller. public string CallerDisplayName { get; } + /// Custom Context of Incoming Call. public AcsIncomingCallCustomContext CustomContext { get; } + /// Signed incoming call context. public string IncomingCallContext { get; } + /// The communication identifier of the user on behalf of whom the call is made. public CommunicationIdentifierModel OnBehalfOfCallee { get; } + /// CorrelationId (CallId). public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsInteractiveReplyKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsInteractiveReplyKind.cs index 0ab05d173ed6..8754a91b7a09 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsInteractiveReplyKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsInteractiveReplyKind.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsInteractiveReplyKind : IEquatable { private readonly string _value; + /// Messaged interactive reply type is ButtonReply. + private const string ButtonReplyValue = "buttonReply"; + /// Messaged interactive reply type is ListReply. + private const string ListReplyValue = "listReply"; + /// Messaged interactive reply type is Unknown. + private const string UnknownValue = "unknown"; /// Initializes a new instance of . + /// The value. /// is null. public AcsInteractiveReplyKind(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ButtonReplyValue = "buttonReply"; - private const string ListReplyValue = "listReply"; - private const string UnknownValue = "unknown"; + _value = value; + } /// Messaged interactive reply type is ButtonReply. public static AcsInteractiveReplyKind ButtonReply { get; } = new AcsInteractiveReplyKind(ButtonReplyValue); + /// Messaged interactive reply type is ListReply. public static AcsInteractiveReplyKind ListReply { get; } = new AcsInteractiveReplyKind(ListReplyValue); + /// Messaged interactive reply type is Unknown. public static AcsInteractiveReplyKind Unknown { get; } = new AcsInteractiveReplyKind(UnknownValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsInteractiveReplyKind left, AcsInteractiveReplyKind right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsInteractiveReplyKind left, AcsInteractiveReplyKind right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsInteractiveReplyKind(string value) => new AcsInteractiveReplyKind(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsInteractiveReplyKind?(string value) => value == null ? null : new AcsInteractiveReplyKind(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsInteractiveReplyKind other && Equals(other); - /// + + /// public bool Equals(AcsInteractiveReplyKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.Serialization.cs index 70456b7fddac..311bcac3f945 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageButtonContent : IUtf8JsonSerializable, IJsonModel + /// Message Button Content. + public partial class AcsMessageButtonContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageButtonContent)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Text)) { writer.WritePropertyName("text"u8); @@ -44,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("payload"u8); writer.WriteStringValue(Payload); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageButtonContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageButtonContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageButtonContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageButtonContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageButtonContent(document.RootElement, options); } - internal static AcsMessageButtonContent DeserializeAcsMessageButtonContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageButtonContent DeserializeAcsMessageButtonContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string text = default; string payload = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("text"u8)) + if (prop.NameEquals("text"u8)) { - text = property.Value.GetString(); + text = prop.Value.GetString(); continue; } - if (property.NameEquals("payload"u8)) + if (prop.NameEquals("payload"u8)) { - payload = property.Value.GetString(); + payload = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageButtonContent(text, payload, serializedAdditionalRawData); + return new AcsMessageButtonContent(text, payload, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - AcsMessageButtonContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageButtonContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageButtonContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageButtonContent(document.RootElement, options); } default: @@ -135,22 +145,7 @@ AcsMessageButtonContent IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageButtonContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageButtonContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.cs index 45a1fd73025a..bc0e9a3846ea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageButtonContent.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Button Content. public partial class AcsMessageButtonContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsMessageButtonContent() @@ -53,16 +24,17 @@ internal AcsMessageButtonContent() /// Initializes a new instance of . /// The Text of the button. /// The Payload of the button which was clicked by the user, setup by the business. - /// Keeps track of any properties unknown to the library. - internal AcsMessageButtonContent(string text, string payload, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageButtonContent(string text, string payload, IDictionary additionalBinaryDataProperties) { Text = text; Payload = payload; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Text of the button. public string Text { get; } + /// The Payload of the button which was clicked by the user, setup by the business. public string Payload { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.Serialization.cs index 97fe67fa1868..292c3b20d842 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.Serialization.cs @@ -9,14 +9,13 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - internal partial class AcsMessageChannelEventError : IUtf8JsonSerializable, IJsonModel + internal partial class AcsMessageChannelEventError : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +27,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageChannelEventError)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ChannelCode)) { writer.WritePropertyName("channelCode"u8); @@ -44,15 +42,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("channelMessage"u8); writer.WriteStringValue(ChannelMessage); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +59,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageChannelEventError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageChannelEventError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageChannelEventError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageChannelEventError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageChannelEventError(document.RootElement, options); } - internal static AcsMessageChannelEventError DeserializeAcsMessageChannelEventError(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageChannelEventError DeserializeAcsMessageChannelEventError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string channelCode = default; string channelMessage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("channelCode"u8)) + if (prop.NameEquals("channelCode"u8)) { - channelCode = property.Value.GetString(); + channelCode = prop.Value.GetString(); continue; } - if (property.NameEquals("channelMessage"u8)) + if (prop.NameEquals("channelMessage"u8)) { - channelMessage = property.Value.GetString(); + channelMessage = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageChannelEventError(channelCode, channelMessage, serializedAdditionalRawData); + return new AcsMessageChannelEventError(channelCode, channelMessage, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +123,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AcsMessageChannelEventError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageChannelEventError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageChannelEventError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageChannelEventError(document.RootElement, options); } default: @@ -135,22 +144,7 @@ AcsMessageChannelEventError IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageChannelEventError FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageChannelEventError(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.cs index 2f1f9f4da487..d6dc0a191ddd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelEventError.cs @@ -10,40 +10,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - /// Message Channel Event Error. internal partial class AcsMessageChannelEventError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsMessageChannelEventError() @@ -53,16 +23,17 @@ internal AcsMessageChannelEventError() /// Initializes a new instance of . /// The channel error code. /// The channel error message. - /// Keeps track of any properties unknown to the library. - internal AcsMessageChannelEventError(string channelCode, string channelMessage, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageChannelEventError(string channelCode, string channelMessage, IDictionary additionalBinaryDataProperties) { ChannelCode = channelCode; ChannelMessage = channelMessage; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The channel error code. public string ChannelCode { get; } + /// The channel error message. public string ChannelMessage { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelKind.cs index 6fb22ab63ec1..a5e3cfa7cdc3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageChannelKind.cs @@ -14,35 +14,52 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsMessageChannelKind : IEquatable { private readonly string _value; + /// Updated message channel type is WhatsApp. + private const string WhatsappValue = "whatsapp"; /// Initializes a new instance of . + /// The value. /// is null. public AcsMessageChannelKind(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string WhatsappValue = "whatsapp"; + _value = value; + } /// Updated message channel type is WhatsApp. public static AcsMessageChannelKind Whatsapp { get; } = new AcsMessageChannelKind(WhatsappValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsMessageChannelKind left, AcsMessageChannelKind right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsMessageChannelKind left, AcsMessageChannelKind right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsMessageChannelKind(string value) => new AcsMessageChannelKind(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsMessageChannelKind?(string value) => value == null ? null : new AcsMessageChannelKind(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsMessageChannelKind other && Equals(other); - /// + + /// public bool Equals(AcsMessageChannelKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.Serialization.cs index f617e4c08702..f8e936216310 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageContext : IUtf8JsonSerializable, IJsonModel + /// Message Context. + public partial class AcsMessageContext : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageContext)} does not support writing '{format}' format."); } - if (Optional.IsDefined(From)) { writer.WritePropertyName("from"u8); @@ -44,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("id"u8); writer.WriteStringValue(MessageId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageContext JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageContext)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageContext(document.RootElement, options); } - internal static AcsMessageContext DeserializeAcsMessageContext(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageContext DeserializeAcsMessageContext(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string @from = default; - string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string messageId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("from"u8)) + if (prop.NameEquals("from"u8)) { - @from = property.Value.GetString(); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageContext(@from, id, serializedAdditionalRawData); + return new AcsMessageContext(@from, messageId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions o } } - AcsMessageContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageContext PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageContext(document.RootElement, options); } default: @@ -135,22 +145,7 @@ AcsMessageContext IPersistableModel.Create(BinaryData data, M } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageContext FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageContext(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.cs index d347701b6a6c..162aa097169c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageContext.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Context. public partial class AcsMessageContext { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsMessageContext() @@ -53,16 +24,17 @@ internal AcsMessageContext() /// Initializes a new instance of . /// The WhatsApp ID for the customer who replied to an inbound message. /// The message ID for the sent message for an inbound reply. - /// Keeps track of any properties unknown to the library. - internal AcsMessageContext(string @from, string messageId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageContext(string @from, string messageId, IDictionary additionalBinaryDataProperties) { From = @from; MessageId = messageId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The WhatsApp ID for the customer who replied to an inbound message. public string From { get; } + /// The message ID for the sent message for an inbound reply. public string MessageId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatus.cs index afb1a13707cd..357e2b8af597 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatus.cs @@ -14,50 +14,77 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsMessageDeliveryStatus : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AcsMessageDeliveryStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// Read. private const string ReadValue = "read"; + /// Delivered. private const string DeliveredValue = "delivered"; + /// Failed. private const string FailedValue = "failed"; + /// Sent. private const string SentValue = "sent"; + /// Warning. private const string WarningValue = "warning"; + /// Unknown. private const string UnknownValue = "unknown"; + /// Initializes a new instance of . + /// The value. + /// is null. + public AcsMessageDeliveryStatus(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// Read. public static AcsMessageDeliveryStatus Read { get; } = new AcsMessageDeliveryStatus(ReadValue); + /// Delivered. public static AcsMessageDeliveryStatus Delivered { get; } = new AcsMessageDeliveryStatus(DeliveredValue); + /// Failed. public static AcsMessageDeliveryStatus Failed { get; } = new AcsMessageDeliveryStatus(FailedValue); + /// Sent. public static AcsMessageDeliveryStatus Sent { get; } = new AcsMessageDeliveryStatus(SentValue); + /// Warning. public static AcsMessageDeliveryStatus Warning { get; } = new AcsMessageDeliveryStatus(WarningValue); + /// Unknown. public static AcsMessageDeliveryStatus Unknown { get; } = new AcsMessageDeliveryStatus(UnknownValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsMessageDeliveryStatus left, AcsMessageDeliveryStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsMessageDeliveryStatus left, AcsMessageDeliveryStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsMessageDeliveryStatus(string value) => new AcsMessageDeliveryStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsMessageDeliveryStatus?(string value) => value == null ? null : new AcsMessageDeliveryStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsMessageDeliveryStatus other && Equals(other); - /// + + /// public bool Equals(AcsMessageDeliveryStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs index 0b3990d8cf94..ca66b6df6627 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.AdvancedMessageDeliveryStatusUpdated event. [JsonConverter(typeof(AcsMessageDeliveryStatusUpdatedEventDataConverter))] - public partial class AcsMessageDeliveryStatusUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsMessageDeliveryStatusUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsMessageDeliveryStatusUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageDeliveryStatusUpdatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(MessageId)) { @@ -54,109 +58,115 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsMessageDeliveryStatusUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageDeliveryStatusUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsMessageDeliveryStatusUpdatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsMessageEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageDeliveryStatusUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageDeliveryStatusUpdatedEventData(document.RootElement, options); } - internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDeliveryStatusUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDeliveryStatusUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string messageId = default; - AcsMessageDeliveryStatus? status = default; - AcsMessageChannelKind? channelType = default; string @from = default; string to = default; - DateTimeOffset? receivedTimeStamp = default; - AcsMessageChannelEventError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? receivedTimestamp = default; + AcsMessageChannelEventError errorInternal = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string messageId = default; + AcsMessageDeliveryStatus? status = default; + AcsMessageChannelKind? channelKind = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("from"u8)) { - messageId = property.Value.GetString(); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("to"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new AcsMessageDeliveryStatus(property.Value.GetString()); + to = prop.Value.GetString(); continue; } - if (property.NameEquals("channelType"u8)) + if (prop.NameEquals("receivedTimeStamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - channelType = new AcsMessageChannelKind(property.Value.GetString()); + receivedTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("from"u8)) + if (prop.NameEquals("error"u8)) { - @from = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errorInternal = AcsMessageChannelEventError.DeserializeAcsMessageChannelEventError(prop.Value, options); continue; } - if (property.NameEquals("to"u8)) + if (prop.NameEquals("messageId"u8)) { - to = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("receivedTimeStamp"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - receivedTimeStamp = property.Value.GetDateTimeOffset("O"); + status = new AcsMessageDeliveryStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("channelType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = AcsMessageChannelEventError.DeserializeAcsMessageChannelEventError(property.Value, options); + channelKind = new AcsMessageChannelKind(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsMessageDeliveryStatusUpdatedEventData( @from, to, - receivedTimeStamp, - error, - serializedAdditionalRawData, + receivedTimestamp, + errorInternal, + additionalBinaryDataProperties, messageId, status, - channelType); + channelKind); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -166,15 +176,20 @@ BinaryData IPersistableModel.Write(Mod } } - AcsMessageDeliveryStatusUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageDeliveryStatusUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsMessageDeliveryStatusUpdatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsMessageEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageDeliveryStatusUpdatedEventData(document.RootElement, options); } default: @@ -182,35 +197,28 @@ AcsMessageDeliveryStatusUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsMessageDeliveryStatusUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageDeliveryStatusUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsMessageDeliveryStatusUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsMessageDeliveryStatusUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsMessageDeliveryStatusUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsMessageDeliveryStatusUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsMessageDeliveryStatusUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs index a17523958870..825211ef986b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs @@ -16,38 +16,32 @@ public partial class AcsMessageDeliveryStatusUpdatedEventData : AcsMessageEventD /// Initializes a new instance of . /// The message sender. /// The message recipient. - /// or is null. internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to) : base(@from, to) { - Argument.AssertNotNull(@from, nameof(@from)); - Argument.AssertNotNull(to, nameof(to)); } /// Initializes a new instance of . /// The message sender. /// The message recipient. /// The time message was received. - /// The channel event error. - /// Keeps track of any properties unknown to the library. + /// + /// Keeps track of any properties unknown to the library. /// The message id. /// The updated message status. /// The updated message channel type. - internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError errorInternal, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus? status, AcsMessageChannelKind? channelKind) : base(@from, to, receivedTimestamp, errorInternal, serializedAdditionalRawData) + internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError errorInternal, IDictionary additionalBinaryDataProperties, string messageId, AcsMessageDeliveryStatus? status, AcsMessageChannelKind? channelKind) : base(@from, to, receivedTimestamp, errorInternal, additionalBinaryDataProperties) { MessageId = messageId; Status = status; ChannelKind = channelKind; } - /// Initializes a new instance of for deserialization. - internal AcsMessageDeliveryStatusUpdatedEventData() - { - } - /// The message id. public string MessageId { get; } + /// The updated message status. public AcsMessageDeliveryStatus? Status { get; } + /// The updated message channel type. public AcsMessageChannelKind? ChannelKind { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs index 7896cf97d890..1e4d26b5a795 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of all chat thread events. [JsonConverter(typeof(AcsMessageEventDataConverter))] - public partial class AcsMessageEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsMessageEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsMessageEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("from"u8); writer.WriteStringValue(From); writer.WritePropertyName("to"u8); @@ -48,17 +52,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(ErrorInternal)) { writer.WritePropertyName("error"u8); - writer.WriteObjectValue(ErrorInternal, options); + writer.WriteObjectValue(ErrorInternal, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,75 +71,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageEventData(document.RootElement, options); } - internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string @from = default; string to = default; - DateTimeOffset? receivedTimeStamp = default; - AcsMessageChannelEventError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? receivedTimestamp = default; + AcsMessageChannelEventError errorInternal = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("from"u8)) + if (prop.NameEquals("from"u8)) { - @from = property.Value.GetString(); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("to"u8)) + if (prop.NameEquals("to"u8)) { - to = property.Value.GetString(); + to = prop.Value.GetString(); continue; } - if (property.NameEquals("receivedTimeStamp"u8)) + if (prop.NameEquals("receivedTimeStamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - receivedTimeStamp = property.Value.GetDateTimeOffset("O"); + receivedTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = AcsMessageChannelEventError.DeserializeAcsMessageChannelEventError(property.Value, options); + errorInternal = AcsMessageChannelEventError.DeserializeAcsMessageChannelEventError(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageEventData(@from, to, receivedTimeStamp, error, serializedAdditionalRawData); + return new AcsMessageEventData(@from, to, receivedTimestamp, errorInternal, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -145,15 +155,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - AcsMessageEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageEventData(document.RootElement, options); } default: @@ -161,35 +176,28 @@ AcsMessageEventData IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsMessageEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsMessageEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsMessageEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsMessageEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsMessageEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs index 89e81030a43e..2d5eab9ddb9e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all chat thread events. public partial class AcsMessageEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The message sender. /// The message recipient. - /// or is null. internal AcsMessageEventData(string @from, string to) { - Argument.AssertNotNull(@from, nameof(@from)); - Argument.AssertNotNull(to, nameof(to)); - From = @from; To = to; } @@ -62,26 +29,23 @@ internal AcsMessageEventData(string @from, string to) /// The message sender. /// The message recipient. /// The time message was received. - /// The channel event error. - /// Keeps track of any properties unknown to the library. - internal AcsMessageEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError errorInternal, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal AcsMessageEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError errorInternal, IDictionary additionalBinaryDataProperties) { From = @from; To = to; ReceivedTimestamp = receivedTimestamp; ErrorInternal = errorInternal; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsMessageEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The message sender. public string From { get; } + /// The message recipient. public string To { get; } + /// The time message was received. public DateTimeOffset? ReceivedTimestamp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.Serialization.cs index 0ed905d442a3..1ef6350b31c7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageInteractiveButtonReplyContent : IUtf8JsonSerializable, IJsonModel + /// Message Interactive button reply content for a user to business message. + public partial class AcsMessageInteractiveButtonReplyContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageInteractiveButtonReplyContent)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ButtonId)) { writer.WritePropertyName("id"u8); @@ -44,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageInteractiveButtonReplyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageInteractiveButtonReplyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageInteractiveButtonReplyContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageInteractiveButtonReplyContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageInteractiveButtonReplyContent(document.RootElement, options); } - internal static AcsMessageInteractiveButtonReplyContent DeserializeAcsMessageInteractiveButtonReplyContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageInteractiveButtonReplyContent DeserializeAcsMessageInteractiveButtonReplyContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string id = default; + string buttonId = default; string title = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + buttonId = prop.Value.GetString(); continue; } - if (property.NameEquals("title"u8)) + if (prop.NameEquals("title"u8)) { - title = property.Value.GetString(); + title = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageInteractiveButtonReplyContent(id, title, serializedAdditionalRawData); + return new AcsMessageInteractiveButtonReplyContent(buttonId, title, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +124,20 @@ BinaryData IPersistableModel.Write(Mode } } - AcsMessageInteractiveButtonReplyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageInteractiveButtonReplyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageInteractiveButtonReplyContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageInteractiveButtonReplyContent(document.RootElement, options); } default: @@ -135,22 +145,7 @@ AcsMessageInteractiveButtonReplyContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageInteractiveButtonReplyContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageInteractiveButtonReplyContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.cs index 1fe95c67946d..79adc8137e60 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveButtonReplyContent.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Interactive button reply content for a user to business message. public partial class AcsMessageInteractiveButtonReplyContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsMessageInteractiveButtonReplyContent() @@ -53,16 +24,17 @@ internal AcsMessageInteractiveButtonReplyContent() /// Initializes a new instance of . /// The ID of the button. /// The title of the button. - /// Keeps track of any properties unknown to the library. - internal AcsMessageInteractiveButtonReplyContent(string buttonId, string title, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageInteractiveButtonReplyContent(string buttonId, string title, IDictionary additionalBinaryDataProperties) { ButtonId = buttonId; Title = title; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ID of the button. public string ButtonId { get; } + /// The title of the button. public string Title { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs index 340ec133d523..ee08522a5fe1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageInteractiveContent : IUtf8JsonSerializable, IJsonModel + /// Message Interactive Content. + public partial class AcsMessageInteractiveContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageInteractiveContent)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ReplyKind)) { writer.WritePropertyName("type"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("listReply"u8); writer.WriteObjectValue(ListReply, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,73 +65,79 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageInteractiveContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageInteractiveContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageInteractiveContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageInteractiveContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageInteractiveContent(document.RootElement, options); } - internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - AcsInteractiveReplyKind? type = default; + AcsInteractiveReplyKind? replyKind = default; AcsMessageInteractiveButtonReplyContent buttonReply = default; AcsMessageInteractiveListReplyContent listReply = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - type = new AcsInteractiveReplyKind(property.Value.GetString()); + replyKind = new AcsInteractiveReplyKind(prop.Value.GetString()); continue; } - if (property.NameEquals("buttonReply"u8)) + if (prop.NameEquals("buttonReply"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - buttonReply = AcsMessageInteractiveButtonReplyContent.DeserializeAcsMessageInteractiveButtonReplyContent(property.Value, options); + buttonReply = AcsMessageInteractiveButtonReplyContent.DeserializeAcsMessageInteractiveButtonReplyContent(prop.Value, options); continue; } - if (property.NameEquals("listReply"u8)) + if (prop.NameEquals("listReply"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - listReply = AcsMessageInteractiveListReplyContent.DeserializeAcsMessageInteractiveListReplyContent(property.Value, options); + listReply = AcsMessageInteractiveListReplyContent.DeserializeAcsMessageInteractiveListReplyContent(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageInteractiveContent(type, buttonReply, listReply, serializedAdditionalRawData); + return new AcsMessageInteractiveContent(replyKind, buttonReply, listReply, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -142,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - AcsMessageInteractiveContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageInteractiveContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageInteractiveContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageInteractiveContent(document.RootElement, options); } default: @@ -158,22 +168,7 @@ AcsMessageInteractiveContent IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageInteractiveContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageInteractiveContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs index ecec155d597e..e340d7b541c8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Interactive Content. public partial class AcsMessageInteractiveContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsMessageInteractiveContent() @@ -54,19 +25,21 @@ internal AcsMessageInteractiveContent() /// The Message interactive reply type. /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. - /// Keeps track of any properties unknown to the library. - internal AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary additionalBinaryDataProperties) { ReplyKind = replyKind; ButtonReply = buttonReply; ListReply = listReply; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Message interactive reply type. public AcsInteractiveReplyKind? ReplyKind { get; } + /// The Message Sent when a customer clicks a button. public AcsMessageInteractiveButtonReplyContent ButtonReply { get; } + /// The Message Sent when a customer selects an item from a list. public AcsMessageInteractiveListReplyContent ListReply { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.Serialization.cs index 6abd6ca2166e..6de13728401e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageInteractiveListReplyContent : IUtf8JsonSerializable, IJsonModel + /// Message Interactive list reply content for a user to business message. + public partial class AcsMessageInteractiveListReplyContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageInteractiveListReplyContent)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ListItemId)) { writer.WritePropertyName("id"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,61 +65,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageInteractiveListReplyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageInteractiveListReplyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageInteractiveListReplyContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageInteractiveListReplyContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageInteractiveListReplyContent(document.RootElement, options); } - internal static AcsMessageInteractiveListReplyContent DeserializeAcsMessageInteractiveListReplyContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageInteractiveListReplyContent DeserializeAcsMessageInteractiveListReplyContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string id = default; + string listItemId = default; string title = default; string description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + listItemId = prop.Value.GetString(); continue; } - if (property.NameEquals("title"u8)) + if (prop.NameEquals("title"u8)) { - title = property.Value.GetString(); + title = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageInteractiveListReplyContent(id, title, description, serializedAdditionalRawData); + return new AcsMessageInteractiveListReplyContent(listItemId, title, description, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -130,15 +135,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsMessageInteractiveListReplyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageInteractiveListReplyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageInteractiveListReplyContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageInteractiveListReplyContent(document.RootElement, options); } default: @@ -146,22 +156,7 @@ AcsMessageInteractiveListReplyContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageInteractiveListReplyContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageInteractiveListReplyContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.cs index fff70f8e670e..3155dd4624c5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveListReplyContent.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Interactive list reply content for a user to business message. public partial class AcsMessageInteractiveListReplyContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsMessageInteractiveListReplyContent() @@ -54,19 +25,21 @@ internal AcsMessageInteractiveListReplyContent() /// The ID of the selected list item. /// The title of the selected list item. /// The description of the selected row. - /// Keeps track of any properties unknown to the library. - internal AcsMessageInteractiveListReplyContent(string listItemId, string title, string description, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageInteractiveListReplyContent(string listItemId, string title, string description, IDictionary additionalBinaryDataProperties) { ListItemId = listItemId; Title = title; Description = description; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ID of the selected list item. public string ListItemId { get; } + /// The title of the selected list item. public string Title { get; } + /// The description of the selected row. public string Description { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.Serialization.cs index 7460b6fe7136..3f763dd143bf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageMediaContent : IUtf8JsonSerializable, IJsonModel + /// Message Media Content. + public partial class AcsMessageMediaContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsMessageMediaContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageMediaContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("mimeType"u8); writer.WriteStringValue(MimeType); writer.WritePropertyName("id"u8); @@ -53,15 +57,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("animated"u8); writer.WriteBooleanValue(Animated.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -70,83 +74,89 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageMediaContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageMediaContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageMediaContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageMediaContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageMediaContent(document.RootElement, options); } - internal static AcsMessageMediaContent DeserializeAcsMessageMediaContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageMediaContent DeserializeAcsMessageMediaContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string mimeType = default; - string id = default; + string mediaId = default; string fileName = default; string caption = default; bool? animated = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("mimeType"u8)) + if (prop.NameEquals("mimeType"u8)) { - mimeType = property.Value.GetString(); + mimeType = prop.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + mediaId = prop.Value.GetString(); continue; } - if (property.NameEquals("fileName"u8)) + if (prop.NameEquals("fileName"u8)) { - fileName = property.Value.GetString(); + fileName = prop.Value.GetString(); continue; } - if (property.NameEquals("caption"u8)) + if (prop.NameEquals("caption"u8)) { - caption = property.Value.GetString(); + caption = prop.Value.GetString(); continue; } - if (property.NameEquals("animated"u8)) + if (prop.NameEquals("animated"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - animated = property.Value.GetBoolean(); + animated = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsMessageMediaContent( mimeType, - id, + mediaId, fileName, caption, animated, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -156,15 +166,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - AcsMessageMediaContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageMediaContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageMediaContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageMediaContent(document.RootElement, options); } default: @@ -172,22 +187,7 @@ AcsMessageMediaContent IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageMediaContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageMediaContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.cs index d5b38c69c6f2..8afd4fc6e743 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageMediaContent.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Media Content. public partial class AcsMessageMediaContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Required. The MIME type of the file this media represents. /// Required. The media identifier. - /// or is null. internal AcsMessageMediaContent(string mimeType, string mediaId) { - Argument.AssertNotNull(mimeType, nameof(mimeType)); - Argument.AssertNotNull(mediaId, nameof(mediaId)); - MimeType = mimeType; MediaId = mediaId; } @@ -64,30 +31,29 @@ internal AcsMessageMediaContent(string mimeType, string mediaId) /// Optional. The filename of the underlying media file as specified when uploaded. /// Optional. The caption for the media object, if supported and provided. /// Optional. Set to true if the sticker is animated; false otherwise. - /// Keeps track of any properties unknown to the library. - internal AcsMessageMediaContent(string mimeType, string mediaId, string fileName, string caption, bool? animated, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageMediaContent(string mimeType, string mediaId, string fileName, string caption, bool? animated, IDictionary additionalBinaryDataProperties) { MimeType = mimeType; MediaId = mediaId; FileName = fileName; Caption = caption; Animated = animated; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsMessageMediaContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Required. The MIME type of the file this media represents. public string MimeType { get; } + /// Required. The media identifier. public string MediaId { get; } + /// Optional. The filename of the underlying media file as specified when uploaded. public string FileName { get; } + /// Optional. The caption for the media object, if supported and provided. public string Caption { get; } + /// Optional. Set to true if the sticker is animated; false otherwise. public bool? Animated { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.Serialization.cs index 18b71bdc80c8..aee955afd2bb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMessageReactionContent : IUtf8JsonSerializable, IJsonModel + /// Message Reaction Content. + public partial class AcsMessageReactionContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsMessageReactionContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageReactionContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); if (Optional.IsDefined(Emoji)) @@ -41,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("emoji"u8); writer.WriteStringValue(Emoji); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,55 +62,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMessageReactionContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageReactionContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMessageReactionContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageReactionContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageReactionContent(document.RootElement, options); } - internal static AcsMessageReactionContent DeserializeAcsMessageReactionContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageReactionContent DeserializeAcsMessageReactionContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string messageId = default; string emoji = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("emoji"u8)) + if (prop.NameEquals("emoji"u8)) { - emoji = property.Value.GetString(); + emoji = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMessageReactionContent(messageId, emoji, serializedAdditionalRawData); + return new AcsMessageReactionContent(messageId, emoji, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -116,15 +126,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - AcsMessageReactionContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageReactionContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMessageReactionContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageReactionContent(document.RootElement, options); } default: @@ -132,22 +147,7 @@ AcsMessageReactionContent IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMessageReactionContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageReactionContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.cs index 603ce33b464f..eabfb7bc196b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReactionContent.cs @@ -13,66 +13,30 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Message Reaction Content. public partial class AcsMessageReactionContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Required. WhatsApp message ID of the message that the emoji is applied to. - /// is null. internal AcsMessageReactionContent(string messageId) { - Argument.AssertNotNull(messageId, nameof(messageId)); - MessageId = messageId; } /// Initializes a new instance of . /// Required. WhatsApp message ID of the message that the emoji is applied to. /// Optional. Unicode escape sequence of the emoji. - /// Keeps track of any properties unknown to the library. - internal AcsMessageReactionContent(string messageId, string emoji, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMessageReactionContent(string messageId, string emoji, IDictionary additionalBinaryDataProperties) { MessageId = messageId; Emoji = emoji; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsMessageReactionContent() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Required. WhatsApp message ID of the message that the emoji is applied to. public string MessageId { get; } + /// Optional. Unicode escape sequence of the emoji. public string Emoji { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs index e13b4720f69b..76aa0f3d457f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.AdvancedMessageReceived event. [JsonConverter(typeof(AcsMessageReceivedEventDataConverter))] - public partial class AcsMessageReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsMessageReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsMessageReceivedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageReceivedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Content)) { @@ -81,167 +85,173 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsMessageReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMessageReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsMessageReceivedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsMessageEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMessageReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMessageReceivedEventData(document.RootElement, options); } - internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @from = default; + string to = default; + DateTimeOffset? receivedTimestamp = default; + AcsMessageChannelEventError errorInternal = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string content = default; string messageId = default; - AcsMessageChannelKind? channelType = default; + AcsMessageChannelKind? channelKind = default; string messageType = default; - AcsMessageMediaContent media = default; + AcsMessageMediaContent mediaContent = default; AcsMessageReactionContent reaction = default; AcsMessageContext context = default; AcsMessageButtonContent button = default; - AcsMessageInteractiveContent interactive = default; - string @from = default; - string to = default; - DateTimeOffset? receivedTimeStamp = default; - AcsMessageChannelEventError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + AcsMessageInteractiveContent interactiveContent = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("content"u8)) + if (prop.NameEquals("from"u8)) { - content = property.Value.GetString(); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("to"u8)) { - messageId = property.Value.GetString(); + to = prop.Value.GetString(); continue; } - if (property.NameEquals("channelType"u8)) + if (prop.NameEquals("receivedTimeStamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - channelType = new AcsMessageChannelKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("messageType"u8)) - { - messageType = property.Value.GetString(); + receivedTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("media"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - media = AcsMessageMediaContent.DeserializeAcsMessageMediaContent(property.Value, options); + errorInternal = AcsMessageChannelEventError.DeserializeAcsMessageChannelEventError(prop.Value, options); continue; } - if (property.NameEquals("reaction"u8)) + if (prop.NameEquals("content"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - reaction = AcsMessageReactionContent.DeserializeAcsMessageReactionContent(property.Value, options); + content = prop.Value.GetString(); continue; } - if (property.NameEquals("context"u8)) + if (prop.NameEquals("messageId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - context = AcsMessageContext.DeserializeAcsMessageContext(property.Value, options); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("button"u8)) + if (prop.NameEquals("channelType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - button = AcsMessageButtonContent.DeserializeAcsMessageButtonContent(property.Value, options); + channelKind = new AcsMessageChannelKind(prop.Value.GetString()); continue; } - if (property.NameEquals("interactive"u8)) + if (prop.NameEquals("messageType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + messageType = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("media"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - interactive = AcsMessageInteractiveContent.DeserializeAcsMessageInteractiveContent(property.Value, options); + mediaContent = AcsMessageMediaContent.DeserializeAcsMessageMediaContent(prop.Value, options); continue; } - if (property.NameEquals("from"u8)) + if (prop.NameEquals("reaction"u8)) { - @from = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reaction = AcsMessageReactionContent.DeserializeAcsMessageReactionContent(prop.Value, options); continue; } - if (property.NameEquals("to"u8)) + if (prop.NameEquals("context"u8)) { - to = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + context = AcsMessageContext.DeserializeAcsMessageContext(prop.Value, options); continue; } - if (property.NameEquals("receivedTimeStamp"u8)) + if (prop.NameEquals("button"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - receivedTimeStamp = property.Value.GetDateTimeOffset("O"); + button = AcsMessageButtonContent.DeserializeAcsMessageButtonContent(prop.Value, options); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("interactive"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = AcsMessageChannelEventError.DeserializeAcsMessageChannelEventError(property.Value, options); + interactiveContent = AcsMessageInteractiveContent.DeserializeAcsMessageInteractiveContent(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsMessageReceivedEventData( @from, to, - receivedTimeStamp, - error, - serializedAdditionalRawData, + receivedTimestamp, + errorInternal, + additionalBinaryDataProperties, content, messageId, - channelType, + channelKind, messageType, - media, + mediaContent, reaction, context, button, - interactive); + interactiveContent); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -251,15 +261,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AcsMessageReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMessageReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsMessageReceivedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsMessageEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMessageReceivedEventData(document.RootElement, options); } default: @@ -267,35 +282,28 @@ AcsMessageReceivedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsMessageReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMessageReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsMessageReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsMessageReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsMessageReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsMessageReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsMessageReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs index ff37561bc799..d1f3b68c505a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs @@ -17,13 +17,8 @@ public partial class AcsMessageReceivedEventData : AcsMessageEventData /// The message sender. /// The message recipient. /// Required. Whatsapp message type. - /// , or is null. internal AcsMessageReceivedEventData(string @from, string to, string messageType) : base(@from, to) { - Argument.AssertNotNull(@from, nameof(@from)); - Argument.AssertNotNull(to, nameof(to)); - Argument.AssertNotNull(messageType, nameof(messageType)); - MessageType = messageType; } @@ -31,8 +26,8 @@ internal AcsMessageReceivedEventData(string @from, string to, string messageType /// The message sender. /// The message recipient. /// The time message was received. - /// The channel event error. - /// Keeps track of any properties unknown to the library. + /// + /// Keeps track of any properties unknown to the library. /// Optional. The message content. /// Optional. Message ID. Format is Guid as string. /// Required. The message channel type. @@ -42,7 +37,7 @@ internal AcsMessageReceivedEventData(string @from, string to, string messageType /// Optional. The received message context. /// Optional. The received message button content. /// Optional. The received message interactive content. - internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError errorInternal, IDictionary serializedAdditionalRawData, string content, string messageId, AcsMessageChannelKind? channelKind, string messageType, AcsMessageMediaContent mediaContent, AcsMessageReactionContent reaction, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, errorInternal, serializedAdditionalRawData) + internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError errorInternal, IDictionary additionalBinaryDataProperties, string content, string messageId, AcsMessageChannelKind? channelKind, string messageType, AcsMessageMediaContent mediaContent, AcsMessageReactionContent reaction, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, errorInternal, additionalBinaryDataProperties) { Content = content; MessageId = messageId; @@ -55,27 +50,30 @@ internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset? re InteractiveContent = interactiveContent; } - /// Initializes a new instance of for deserialization. - internal AcsMessageReceivedEventData() - { - } - /// Optional. The message content. public string Content { get; } + /// Optional. Message ID. Format is Guid as string. public string MessageId { get; } + /// Required. The message channel type. public AcsMessageChannelKind? ChannelKind { get; } + /// Required. Whatsapp message type. public string MessageType { get; } + /// Optional. The received message media content. public AcsMessageMediaContent MediaContent { get; } + /// Optional. The received message reaction content. public AcsMessageReactionContent Reaction { get; } + /// Optional. The received message context. public AcsMessageContext Context { get; } + /// Optional. The received message button content. public AcsMessageButtonContent Button { get; } + /// Optional. The received message interactive content. public AcsMessageInteractiveContent InteractiveContent { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.Serialization.cs index d0493235eeb6..316bd95c81c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsMicrosoftTeamsAppIdentifier : IUtf8JsonSerializable, IJsonModel + /// A Microsoft Teams application. + public partial class AcsMicrosoftTeamsAppIdentifier : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsMicrosoftTeamsAppIdentifier() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMicrosoftTeamsAppIdentifier)} does not support writing '{format}' format."); } - writer.WritePropertyName("appId"u8); writer.WriteStringValue(AppId); if (Optional.IsDefined(Cloud)) @@ -41,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cloud"u8); writer.WriteStringValue(Cloud.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,59 +62,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsMicrosoftTeamsAppIdentifier IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsMicrosoftTeamsAppIdentifier IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsMicrosoftTeamsAppIdentifier JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsMicrosoftTeamsAppIdentifier)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsMicrosoftTeamsAppIdentifier(document.RootElement, options); } - internal static AcsMicrosoftTeamsAppIdentifier DeserializeAcsMicrosoftTeamsAppIdentifier(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsMicrosoftTeamsAppIdentifier DeserializeAcsMicrosoftTeamsAppIdentifier(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string appId = default; CommunicationCloudEnvironmentModel? cloud = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appId"u8)) + if (prop.NameEquals("appId"u8)) { - appId = property.Value.GetString(); + appId = prop.Value.GetString(); continue; } - if (property.NameEquals("cloud"u8)) + if (prop.NameEquals("cloud"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); + cloud = new CommunicationCloudEnvironmentModel(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsMicrosoftTeamsAppIdentifier(appId, cloud, serializedAdditionalRawData); + return new AcsMicrosoftTeamsAppIdentifier(appId, cloud, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -120,15 +130,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - AcsMicrosoftTeamsAppIdentifier IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsMicrosoftTeamsAppIdentifier IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsMicrosoftTeamsAppIdentifier PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsMicrosoftTeamsAppIdentifier(document.RootElement, options); } default: @@ -136,22 +151,7 @@ AcsMicrosoftTeamsAppIdentifier IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsMicrosoftTeamsAppIdentifier FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsMicrosoftTeamsAppIdentifier(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.cs index 406a69cda710..95a9831370eb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMicrosoftTeamsAppIdentifier.cs @@ -13,66 +13,30 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// A Microsoft Teams application. public partial class AcsMicrosoftTeamsAppIdentifier { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Id of the Microsoft Teams application. - /// is null. internal AcsMicrosoftTeamsAppIdentifier(string appId) { - Argument.AssertNotNull(appId, nameof(appId)); - AppId = appId; } /// Initializes a new instance of . /// The Id of the Microsoft Teams application. /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. - /// Keeps track of any properties unknown to the library. - internal AcsMicrosoftTeamsAppIdentifier(string appId, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsMicrosoftTeamsAppIdentifier(string appId, CommunicationCloudEnvironmentModel? cloud, IDictionary additionalBinaryDataProperties) { AppId = appId; Cloud = cloud; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsMicrosoftTeamsAppIdentifier() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Id of the Microsoft Teams application. public string AppId { get; } + /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. public CommunicationCloudEnvironmentModel? Cloud { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChannelType.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChannelType.cs index 939c3cd790a7..4c9f5e3ccc39 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChannelType.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChannelType.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRecordingChannelType : IEquatable { private readonly string _value; + /// Mixed channel type. + private const string MixedValue = "Mixed"; + /// Unmixed channel type. + private const string UnmixedValue = "Unmixed"; /// Initializes a new instance of . + /// The value. /// is null. public AcsRecordingChannelType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string MixedValue = "Mixed"; - private const string UnmixedValue = "Unmixed"; + _value = value; + } /// Mixed channel type. public static AcsRecordingChannelType Mixed { get; } = new AcsRecordingChannelType(MixedValue); + /// Unmixed channel type. public static AcsRecordingChannelType Unmixed { get; } = new AcsRecordingChannelType(UnmixedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRecordingChannelType left, AcsRecordingChannelType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRecordingChannelType left, AcsRecordingChannelType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRecordingChannelType(string value) => new AcsRecordingChannelType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRecordingChannelType?(string value) => value == null ? null : new AcsRecordingChannelType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRecordingChannelType other && Equals(other); - /// + + /// public bool Equals(AcsRecordingChannelType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.Serialization.cs index 7f5e29de3127..ba7e735ebabe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsRecordingChunkInfoProperties : IUtf8JsonSerializable, IJsonModel + /// Schema for all properties of Recording Chunk Information. + public partial class AcsRecordingChunkInfoProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRecordingChunkInfoProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(DocumentId)) { writer.WritePropertyName("documentId"u8); @@ -64,15 +63,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("deleteLocation"u8); writer.WriteStringValue(DeleteLocation); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -81,22 +80,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRecordingChunkInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRecordingChunkInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRecordingChunkInfoProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRecordingChunkInfoProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRecordingChunkInfoProperties(document.RootElement, options); } - internal static AcsRecordingChunkInfoProperties DeserializeAcsRecordingChunkInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRecordingChunkInfoProperties DeserializeAcsRecordingChunkInfoProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -107,50 +111,48 @@ internal static AcsRecordingChunkInfoProperties DeserializeAcsRecordingChunkInfo string metadataLocation = default; string contentLocation = default; string deleteLocation = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("documentId"u8)) + if (prop.NameEquals("documentId"u8)) { - documentId = property.Value.GetString(); + documentId = prop.Value.GetString(); continue; } - if (property.NameEquals("index"u8)) + if (prop.NameEquals("index"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - index = property.Value.GetInt64(); + index = prop.Value.GetInt64(); continue; } - if (property.NameEquals("endReason"u8)) + if (prop.NameEquals("endReason"u8)) { - endReason = property.Value.GetString(); + endReason = prop.Value.GetString(); continue; } - if (property.NameEquals("metadataLocation"u8)) + if (prop.NameEquals("metadataLocation"u8)) { - metadataLocation = property.Value.GetString(); + metadataLocation = prop.Value.GetString(); continue; } - if (property.NameEquals("contentLocation"u8)) + if (prop.NameEquals("contentLocation"u8)) { - contentLocation = property.Value.GetString(); + contentLocation = prop.Value.GetString(); continue; } - if (property.NameEquals("deleteLocation"u8)) + if (prop.NameEquals("deleteLocation"u8)) { - deleteLocation = property.Value.GetString(); + deleteLocation = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRecordingChunkInfoProperties( documentId, index, @@ -158,13 +160,16 @@ internal static AcsRecordingChunkInfoProperties DeserializeAcsRecordingChunkInfo metadataLocation, contentLocation, deleteLocation, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -174,15 +179,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsRecordingChunkInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRecordingChunkInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRecordingChunkInfoProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRecordingChunkInfoProperties(document.RootElement, options); } default: @@ -190,22 +200,7 @@ AcsRecordingChunkInfoProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRecordingChunkInfoProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRecordingChunkInfoProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.cs index e27b518ff320..7d79ef8a07ea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingChunkInfoProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema for all properties of Recording Chunk Information. public partial class AcsRecordingChunkInfoProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsRecordingChunkInfoProperties() @@ -57,8 +28,8 @@ internal AcsRecordingChunkInfoProperties() /// The location of the metadata for this chunk. /// The location of the content for this chunk. /// The location to delete all chunk storage. - /// Keeps track of any properties unknown to the library. - internal AcsRecordingChunkInfoProperties(string documentId, long? index, string endReason, string metadataLocation, string contentLocation, string deleteLocation, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRecordingChunkInfoProperties(string documentId, long? index, string endReason, string metadataLocation, string contentLocation, string deleteLocation, IDictionary additionalBinaryDataProperties) { DocumentId = documentId; Index = index; @@ -66,19 +37,24 @@ internal AcsRecordingChunkInfoProperties(string documentId, long? index, string MetadataLocation = metadataLocation; ContentLocation = contentLocation; DeleteLocation = deleteLocation; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The documentId of the recording chunk. public string DocumentId { get; } + /// The index of the recording chunk. public long? Index { get; } + /// The reason for ending the recording chunk. public string EndReason { get; } + /// The location of the metadata for this chunk. public string MetadataLocation { get; } + /// The location of the content for this chunk. public string ContentLocation { get; } + /// The location to delete all chunk storage. public string DeleteLocation { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingContentType.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingContentType.cs index 2293756f2703..83ec23686dc7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingContentType.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingContentType.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRecordingContentType : IEquatable { private readonly string _value; + /// AudioVideo content type. + private const string AudioVideoValue = "AudioVideo"; + /// Audio content type. + private const string AudioValue = "Audio"; /// Initializes a new instance of . + /// The value. /// is null. public AcsRecordingContentType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string AudioVideoValue = "AudioVideo"; - private const string AudioValue = "Audio"; + _value = value; + } /// AudioVideo content type. public static AcsRecordingContentType AudioVideo { get; } = new AcsRecordingContentType(AudioVideoValue); + /// Audio content type. public static AcsRecordingContentType Audio { get; } = new AcsRecordingContentType(AudioValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRecordingContentType left, AcsRecordingContentType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRecordingContentType left, AcsRecordingContentType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRecordingContentType(string value) => new AcsRecordingContentType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRecordingContentType?(string value) => value == null ? null : new AcsRecordingContentType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRecordingContentType other && Equals(other); - /// + + /// public bool Equals(AcsRecordingContentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs index cff63f98dd4b..2d9c0df27a35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event. [JsonConverter(typeof(AcsRecordingFileStatusUpdatedEventDataConverter))] - public partial class AcsRecordingFileStatusUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRecordingFileStatusUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRecordingFileStatusUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRecordingFileStatusUpdatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("recordingStorageInfo"u8); writer.WriteObjectValue(RecordingStorageInfo, options); if (Optional.IsDefined(RecordingStartTime)) @@ -68,15 +72,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sessionEndReason"u8); writer.WriteStringValue(SessionEndReason); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -85,22 +89,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRecordingFileStatusUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRecordingFileStatusUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRecordingFileStatusUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRecordingFileStatusUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRecordingFileStatusUpdatedEventData(document.RootElement, options); } - internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFileStatusUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFileStatusUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -108,90 +117,91 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi AcsRecordingStorageInfoProperties recordingStorageInfo = default; DateTimeOffset? recordingStartTime = default; long? recordingDurationMs = default; - AcsRecordingContentType? recordingContentType = default; - AcsRecordingChannelType? recordingChannelType = default; - AcsRecordingFormatType? recordingFormatType = default; + AcsRecordingContentType? contentType = default; + AcsRecordingChannelType? channelType = default; + AcsRecordingFormatType? formatType = default; string sessionEndReason = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("recordingStorageInfo"u8)) + if (prop.NameEquals("recordingStorageInfo"u8)) { - recordingStorageInfo = AcsRecordingStorageInfoProperties.DeserializeAcsRecordingStorageInfoProperties(property.Value, options); + recordingStorageInfo = AcsRecordingStorageInfoProperties.DeserializeAcsRecordingStorageInfoProperties(prop.Value, options); continue; } - if (property.NameEquals("recordingStartTime"u8)) + if (prop.NameEquals("recordingStartTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - recordingStartTime = property.Value.GetDateTimeOffset("O"); + recordingStartTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("recordingDurationMs"u8)) + if (prop.NameEquals("recordingDurationMs"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - recordingDurationMs = property.Value.GetInt64(); + recordingDurationMs = prop.Value.GetInt64(); continue; } - if (property.NameEquals("recordingContentType"u8)) + if (prop.NameEquals("recordingContentType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - recordingContentType = new AcsRecordingContentType(property.Value.GetString()); + contentType = new AcsRecordingContentType(prop.Value.GetString()); continue; } - if (property.NameEquals("recordingChannelType"u8)) + if (prop.NameEquals("recordingChannelType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - recordingChannelType = new AcsRecordingChannelType(property.Value.GetString()); + channelType = new AcsRecordingChannelType(prop.Value.GetString()); continue; } - if (property.NameEquals("recordingFormatType"u8)) + if (prop.NameEquals("recordingFormatType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - recordingFormatType = new AcsRecordingFormatType(property.Value.GetString()); + formatType = new AcsRecordingFormatType(prop.Value.GetString()); continue; } - if (property.NameEquals("sessionEndReason"u8)) + if (prop.NameEquals("sessionEndReason"u8)) { - sessionEndReason = property.Value.GetString(); + sessionEndReason = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRecordingFileStatusUpdatedEventData( recordingStorageInfo, recordingStartTime, recordingDurationMs, - recordingContentType, - recordingChannelType, - recordingFormatType, + contentType, + channelType, + formatType, sessionEndReason, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -201,15 +211,20 @@ BinaryData IPersistableModel.Write(Model } } - AcsRecordingFileStatusUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRecordingFileStatusUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRecordingFileStatusUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRecordingFileStatusUpdatedEventData(document.RootElement, options); } default: @@ -217,35 +232,28 @@ AcsRecordingFileStatusUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRecordingFileStatusUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRecordingFileStatusUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRecordingFileStatusUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRecordingFileStatusUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRecordingFileStatusUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRecordingFileStatusUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRecordingFileStatusUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs index 658248f14850..33603ef8fbb4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event. public partial class AcsRecordingFileStatusUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The details of recording storage information. - /// is null. internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo) { - Argument.AssertNotNull(recordingStorageInfo, nameof(recordingStorageInfo)); - RecordingStorageInfo = recordingStorageInfo; } @@ -63,8 +31,8 @@ internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoPropertie /// The recording channel type - Mixed, Unmixed. /// The recording format type - Mp4, Mp3, Wav. /// The reason for ending recording session. - /// Keeps track of any properties unknown to the library. - internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset? recordingStartTime, long? recordingDurationMs, AcsRecordingContentType? contentType, AcsRecordingChannelType? channelType, AcsRecordingFormatType? formatType, string sessionEndReason, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset? recordingStartTime, long? recordingDurationMs, AcsRecordingContentType? contentType, AcsRecordingChannelType? channelType, AcsRecordingFormatType? formatType, string sessionEndReason, IDictionary additionalBinaryDataProperties) { RecordingStorageInfo = recordingStorageInfo; RecordingStartTime = recordingStartTime; @@ -73,26 +41,27 @@ internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoPropertie ChannelType = channelType; FormatType = formatType; SessionEndReason = sessionEndReason; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsRecordingFileStatusUpdatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The details of recording storage information. public AcsRecordingStorageInfoProperties RecordingStorageInfo { get; } + /// The time at which the recording started. public DateTimeOffset? RecordingStartTime { get; } + /// The recording duration in milliseconds. public long? RecordingDurationMs { get; } + /// The recording content type- AudioVideo, or Audio. public AcsRecordingContentType? ContentType { get; } + /// The recording channel type - Mixed, Unmixed. public AcsRecordingChannelType? ChannelType { get; } + /// The recording format type - Mp4, Mp3, Wav. public AcsRecordingFormatType? FormatType { get; } + /// The reason for ending recording session. public string SessionEndReason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFormatType.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFormatType.cs index 9cb36c0c4231..2cc7e05c3a23 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFormatType.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFormatType.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRecordingFormatType : IEquatable { private readonly string _value; + /// WAV format. + private const string WavValue = "Wav"; + /// MP3 format. + private const string Mp3Value = "Mp3"; + /// MP4 format. + private const string Mp4Value = "Mp4"; /// Initializes a new instance of . + /// The value. /// is null. public AcsRecordingFormatType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string WavValue = "Wav"; - private const string Mp3Value = "Mp3"; - private const string Mp4Value = "Mp4"; + _value = value; + } /// WAV format. public static AcsRecordingFormatType Wav { get; } = new AcsRecordingFormatType(WavValue); + /// MP3 format. public static AcsRecordingFormatType Mp3 { get; } = new AcsRecordingFormatType(Mp3Value); + /// MP4 format. public static AcsRecordingFormatType Mp4 { get; } = new AcsRecordingFormatType(Mp4Value); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRecordingFormatType left, AcsRecordingFormatType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRecordingFormatType left, AcsRecordingFormatType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRecordingFormatType(string value) => new AcsRecordingFormatType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRecordingFormatType?(string value) => value == null ? null : new AcsRecordingFormatType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRecordingFormatType other && Equals(other); - /// + + /// public bool Equals(AcsRecordingFormatType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.Serialization.cs index 245ed8cf9211..5c1996a14625 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsRecordingStorageInfoProperties : IUtf8JsonSerializable, IJsonModel + /// Schema for all properties of Recording Storage Information. + public partial class AcsRecordingStorageInfoProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,31 +28,30 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRecordingStorageInfoProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") { writer.WritePropertyName("recordingChunks"u8); writer.WriteStartArray(); - foreach (var item in RecordingChunks) + foreach (AcsRecordingChunkInfoProperties item in RecordingChunks) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,35 +60,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRecordingStorageInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRecordingStorageInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRecordingStorageInfoProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRecordingStorageInfoProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRecordingStorageInfoProperties(document.RootElement, options); } - internal static AcsRecordingStorageInfoProperties DeserializeAcsRecordingStorageInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRecordingStorageInfoProperties DeserializeAcsRecordingStorageInfoProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IReadOnlyList recordingChunks = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("recordingChunks"u8)) + if (prop.NameEquals("recordingChunks"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsRecordingChunkInfoProperties.DeserializeAcsRecordingChunkInfoProperties(item, options)); } @@ -98,17 +101,19 @@ internal static AcsRecordingStorageInfoProperties DeserializeAcsRecordingStorage } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRecordingStorageInfoProperties(recordingChunks, serializedAdditionalRawData); + return new AcsRecordingStorageInfoProperties(recordingChunks, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -118,15 +123,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - AcsRecordingStorageInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRecordingStorageInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRecordingStorageInfoProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRecordingStorageInfoProperties(document.RootElement, options); } default: @@ -134,22 +144,7 @@ AcsRecordingStorageInfoProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRecordingStorageInfoProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRecordingStorageInfoProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.cs index 44b951440b82..2d9c513299d5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingStorageInfoProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema for all properties of Recording Storage Information. public partial class AcsRecordingStorageInfoProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsRecordingStorageInfoProperties() @@ -53,11 +24,11 @@ internal AcsRecordingStorageInfoProperties() /// Initializes a new instance of . /// List of details of recording chunks information. - /// Keeps track of any properties unknown to the library. - internal AcsRecordingStorageInfoProperties(IReadOnlyList recordingChunks, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRecordingStorageInfoProperties(IReadOnlyList recordingChunks, IDictionary additionalBinaryDataProperties) { RecordingChunks = recordingChunks; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// List of details of recording chunks information. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.Serialization.cs index 483371133b51..43497e4229b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsRouterChannelConfiguration : IUtf8JsonSerializable, IJsonModel + /// Router Channel Configuration. + public partial class AcsRouterChannelConfiguration : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterChannelConfiguration)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ChannelId)) { writer.WritePropertyName("channelId"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("maxNumberOfJobs"u8); writer.WriteNumberValue(MaxNumberOfJobs.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterChannelConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterChannelConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterChannelConfiguration JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterChannelConfiguration)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterChannelConfiguration(document.RootElement, options); } - internal static AcsRouterChannelConfiguration DeserializeAcsRouterChannelConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterChannelConfiguration DeserializeAcsRouterChannelConfiguration(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,46 +93,47 @@ internal static AcsRouterChannelConfiguration DeserializeAcsRouterChannelConfigu string channelId = default; int? capacityCostPerJob = default; int? maxNumberOfJobs = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("channelId"u8)) { - channelId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("capacityCostPerJob"u8)) + if (prop.NameEquals("capacityCostPerJob"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - capacityCostPerJob = property.Value.GetInt32(); + capacityCostPerJob = prop.Value.GetInt32(); continue; } - if (property.NameEquals("maxNumberOfJobs"u8)) + if (prop.NameEquals("maxNumberOfJobs"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - maxNumberOfJobs = property.Value.GetInt32(); + maxNumberOfJobs = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRouterChannelConfiguration(channelId, capacityCostPerJob, maxNumberOfJobs, serializedAdditionalRawData); + return new AcsRouterChannelConfiguration(channelId, capacityCostPerJob, maxNumberOfJobs, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AcsRouterChannelConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterChannelConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterChannelConfiguration PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterChannelConfiguration(document.RootElement, options); } default: @@ -154,22 +164,7 @@ AcsRouterChannelConfiguration IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterChannelConfiguration FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterChannelConfiguration(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.cs index 9b3d3e8de17f..581292d39354 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterChannelConfiguration.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Router Channel Configuration. public partial class AcsRouterChannelConfiguration { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsRouterChannelConfiguration() @@ -54,19 +25,21 @@ internal AcsRouterChannelConfiguration() /// Channel ID for Router Job. /// Capacity Cost Per Job for Router Job. /// Max Number of Jobs for Router Job. - /// Keeps track of any properties unknown to the library. - internal AcsRouterChannelConfiguration(string channelId, int? capacityCostPerJob, int? maxNumberOfJobs, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterChannelConfiguration(string channelId, int? capacityCostPerJob, int? maxNumberOfJobs, IDictionary additionalBinaryDataProperties) { ChannelId = channelId; CapacityCostPerJob = capacityCostPerJob; MaxNumberOfJobs = maxNumberOfJobs; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Channel ID for Router Job. public string ChannelId { get; } + /// Capacity Cost Per Job for Router Job. public int? CapacityCostPerJob { get; } + /// Max Number of Jobs for Router Job. public int? MaxNumberOfJobs { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.Serialization.cs index 8c025c062103..5acf3411d818 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.Serialization.cs @@ -9,14 +9,18 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - internal partial class AcsRouterCommunicationError : IUtf8JsonSerializable, IJsonModel + internal partial class AcsRouterCommunicationError : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterCommunicationError() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +32,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterCommunicationError)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -55,21 +58,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("details"u8); writer.WriteStartArray(); - foreach (var item in Details) + foreach (AcsRouterCommunicationError item in Details) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -78,22 +81,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterCommunicationError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterCommunicationError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterCommunicationError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterCommunicationError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterCommunicationError(document.RootElement, options); } - internal static AcsRouterCommunicationError DeserializeAcsRouterCommunicationError(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterCommunicationError DeserializeAcsRouterCommunicationError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -103,34 +111,33 @@ internal static AcsRouterCommunicationError DeserializeAcsRouterCommunicationErr string target = default; AcsRouterCommunicationError innererror = default; IReadOnlyList details = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - code = property.Value.GetString(); + code = prop.Value.GetString(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = property.Value.GetString(); + target = prop.Value.GetString(); continue; } - if (property.NameEquals("innererror"u8)) + if (prop.NameEquals("innererror"u8)) { - innererror = DeserializeAcsRouterCommunicationError(property.Value, options); + innererror = DeserializeAcsRouterCommunicationError(prop.Value, options); continue; } - if (property.NameEquals("details"u8)) + if (prop.NameEquals("details"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(DeserializeAcsRouterCommunicationError(item, options)); } @@ -139,23 +146,25 @@ internal static AcsRouterCommunicationError DeserializeAcsRouterCommunicationErr } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterCommunicationError( code, message, target, innererror, details, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -165,15 +174,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AcsRouterCommunicationError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterCommunicationError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterCommunicationError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterCommunicationError(document.RootElement, options); } default: @@ -181,22 +195,7 @@ AcsRouterCommunicationError IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterCommunicationError FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterCommunicationError(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.cs index f625f72cfa00..a956837c1845 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterCommunicationError.cs @@ -10,48 +10,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - /// Router Communication Error. internal partial class AcsRouterCommunicationError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Router Communication Inner Error. - /// is null. internal AcsRouterCommunicationError(AcsRouterCommunicationError innererror) { - Argument.AssertNotNull(innererror, nameof(innererror)); - Innererror = innererror; Details = new ChangeTrackingList(); } @@ -62,30 +29,29 @@ internal AcsRouterCommunicationError(AcsRouterCommunicationError innererror) /// Router Communication Error Target. /// Router Communication Inner Error. /// List of Router Communication Errors. - /// Keeps track of any properties unknown to the library. - internal AcsRouterCommunicationError(string code, string message, string target, AcsRouterCommunicationError innererror, IReadOnlyList details, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterCommunicationError(string code, string message, string target, AcsRouterCommunicationError innererror, IReadOnlyList details, IDictionary additionalBinaryDataProperties) { Code = code; Message = message; Target = target; Innererror = innererror; Details = details; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsRouterCommunicationError() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Communication Error Code. public string Code { get; } + /// Router Communication Error Message. public string Message { get; } + /// Router Communication Error Target. public string Target { get; } + /// Router Communication Inner Error. public AcsRouterCommunicationError Innererror { get; } + /// List of Router Communication Errors. public IReadOnlyList Details { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.Serialization.cs index d335a43866e5..4fcf608bf653 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of all Router events. [JsonConverter(typeof(AcsRouterEventDataConverter))] - public partial class AcsRouterEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(JobId)) { writer.WritePropertyName("jobId"u8); @@ -51,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("channelId"u8); writer.WriteStringValue(ChannelId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterEventData(document.RootElement, options); } - internal static AcsRouterEventData DeserializeAcsRouterEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterEventData DeserializeAcsRouterEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,38 +95,39 @@ internal static AcsRouterEventData DeserializeAcsRouterEventData(JsonElement ele string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("jobId"u8)) { - jobId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("channelReference"u8)) { - channelReference = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("channelId"u8)) { - channelId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRouterEventData(jobId, channelReference, channelId, serializedAdditionalRawData); + return new AcsRouterEventData(jobId, channelReference, channelId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -132,15 +137,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - AcsRouterEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterEventData(document.RootElement, options); } default: @@ -148,35 +158,28 @@ AcsRouterEventData IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.cs index ef5256da1f16..235a4fd24fb2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all Router events. public partial class AcsRouterEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsRouterEventData() @@ -54,19 +25,21 @@ internal AcsRouterEventData() /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. - internal AcsRouterEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties) { JobId = jobId; ChannelReference = channelReference; ChannelId = channelId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Event Job ID. public string JobId { get; } + /// Router Event Channel Reference. public string ChannelReference { get; } + /// Router Event Channel ID. public string ChannelId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs index 384d004daa65..e6d081603f8c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobCancelled event. [JsonConverter(typeof(AcsRouterJobCancelledEventDataConverter))] - public partial class AcsRouterJobCancelledEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobCancelledEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobCancelledEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobCancelledEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Note)) { @@ -49,99 +53,116 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobCancelledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobCancelledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobCancelledEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobCancelledEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobCancelledEventData(document.RootElement, options); } - internal static AcsRouterJobCancelledEventData DeserializeAcsRouterJobCancelledEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobCancelledEventData DeserializeAcsRouterJobCancelledEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string note = default; - string dispositionCode = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + string note = default; + string dispositionCode = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("note"u8)) + if (prop.NameEquals("jobId"u8)) { - note = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("dispositionCode"u8)) + if (prop.NameEquals("channelReference"u8)) { - dispositionCode = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("channelId"u8)) { - queueId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("queueId"u8)) + { + queueId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("note"u8)) { - channelReference = property.Value.GetString(); + note = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("dispositionCode"u8)) { - channelId = property.Value.GetString(); + dispositionCode = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobCancelledEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -149,10 +170,13 @@ internal static AcsRouterJobCancelledEventData DeserializeAcsRouterJobCancelledE dispositionCode); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +186,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - AcsRouterJobCancelledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobCancelledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobCancelledEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobCancelledEventData(document.RootElement, options); } default: @@ -178,35 +207,28 @@ AcsRouterJobCancelledEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobCancelledEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobCancelledEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobCancelledEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobCancelledEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobCancelledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobCancelledEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobCancelledEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs index ec856a4acd43..dc5be28ad9c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs @@ -16,36 +16,29 @@ public partial class AcsRouterJobCancelledEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobCancelledEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); } /// Initializes a new instance of . /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Note. /// Router Job Disposition Code. - internal AcsRouterJobCancelledEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string note, string dispositionCode) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobCancelledEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string note, string dispositionCode) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { Note = note; DispositionCode = dispositionCode; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobCancelledEventData() - { - } - /// Router Job Note. public string Note { get; } + /// Router Job Disposition Code. public string DispositionCode { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs index 266d6327fab0..e4cd8e5776eb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClassificationFailed event. [JsonConverter(typeof(AcsRouterJobClassificationFailedEventDataConverter))] - public partial class AcsRouterJobClassificationFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobClassificationFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobClassificationFailedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobClassificationFailedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(ClassificationPolicyId)) { @@ -46,123 +50,143 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("errors"u8); writer.WriteStartArray(); - foreach (var item in ErrorsInternal) + foreach (AcsRouterCommunicationError item in ErrorsInternal) { - writer.WriteObjectValue(item, options); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } } - AcsRouterJobClassificationFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobClassificationFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobClassificationFailedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobClassificationFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobClassificationFailedEventData(document.RootElement, options); } - internal static AcsRouterJobClassificationFailedEventData DeserializeAcsRouterJobClassificationFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobClassificationFailedEventData DeserializeAcsRouterJobClassificationFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string classificationPolicyId = default; - IReadOnlyList errors = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + string classificationPolicyId = default; + IReadOnlyList errorsInternal = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("classificationPolicyId"u8)) + if (prop.NameEquals("jobId"u8)) { - classificationPolicyId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("errors"u8)) + if (prop.NameEquals("channelReference"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterCommunicationError.DeserializeAcsRouterCommunicationError(item, options)); - } - errors = array; + channelReference = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("channelId"u8)) + { + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("queueId"u8)) { - queueId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("classificationPolicyId"u8)) { - channelReference = property.Value.GetString(); + classificationPolicyId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("errors"u8)) { - channelId = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterCommunicationError.DeserializeAcsRouterCommunicationError(item, options)); + } + errorsInternal = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobClassificationFailedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, classificationPolicyId, - errors); + errorsInternal); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -172,15 +196,20 @@ BinaryData IPersistableModel.Write(Mo } } - AcsRouterJobClassificationFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobClassificationFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobClassificationFailedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobClassificationFailedEventData(document.RootElement, options); } default: @@ -188,35 +217,28 @@ AcsRouterJobClassificationFailedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobClassificationFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobClassificationFailedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobClassificationFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobClassificationFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobClassificationFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobClassificationFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobClassificationFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs index 4d42062a516f..42722b36aa79 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs @@ -16,12 +16,8 @@ public partial class AcsRouterJobClassificationFailedEventData : AcsRouterJobEve /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobClassificationFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - ErrorsInternal = new ChangeTrackingList(); } @@ -29,23 +25,18 @@ internal AcsRouterJobClassificationFailedEventData(IReadOnlyDictionary Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Classification Policy Id. - /// Router Job Classification Failed Errors. - internal AcsRouterJobClassificationFailedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string classificationPolicyId, IReadOnlyList errorsInternal) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + /// List of Router Communication Errors. + internal AcsRouterJobClassificationFailedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string classificationPolicyId, IReadOnlyList errorsInternal) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { ClassificationPolicyId = classificationPolicyId; ErrorsInternal = errorsInternal; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobClassificationFailedEventData() - { - } - /// Router Job Classification Policy Id. public string ClassificationPolicyId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.Serialization.cs index f3f4227cef13..65c0d85ace84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClassified event. [JsonConverter(typeof(AcsRouterJobClassifiedEventDataConverter))] - public partial class AcsRouterJobClassifiedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobClassifiedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobClassifiedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobClassifiedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("queueDetails"u8); writer.WriteObjectValue(QueueDetails, options); @@ -53,7 +57,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("attachedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in AttachedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in AttachedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -61,120 +65,137 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobClassifiedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobClassifiedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobClassifiedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobClassifiedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobClassifiedEventData(document.RootElement, options); } - internal static AcsRouterJobClassifiedEventData DeserializeAcsRouterJobClassifiedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobClassifiedEventData DeserializeAcsRouterJobClassifiedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string jobId = default; + string channelReference = default; + string channelId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; AcsRouterQueueDetails queueDetails = default; string classificationPolicyId = default; int? priority = default; IReadOnlyList attachedWorkerSelectors = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; - string jobId = default; - string channelReference = default; - string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueDetails"u8)) + if (prop.NameEquals("jobId"u8)) { - queueDetails = AcsRouterQueueDetails.DeserializeAcsRouterQueueDetails(property.Value, options); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("classificationPolicyId"u8)) + if (prop.NameEquals("channelReference"u8)) { - classificationPolicyId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("priority"u8)) + if (prop.NameEquals("channelId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - priority = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("attachedWorkerSelectors"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - attachedWorkerSelectors = array; + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("queueId"u8)) { - queueId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("queueDetails"u8)) { - jobId = property.Value.GetString(); + queueDetails = AcsRouterQueueDetails.DeserializeAcsRouterQueueDetails(prop.Value, options); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("classificationPolicyId"u8)) { - channelReference = property.Value.GetString(); + classificationPolicyId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("priority"u8)) { - channelId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = prop.Value.GetInt32(); + continue; + } + if (prop.NameEquals("attachedWorkerSelectors"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + attachedWorkerSelectors = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobClassifiedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -184,10 +205,13 @@ internal static AcsRouterJobClassifiedEventData DeserializeAcsRouterJobClassifie attachedWorkerSelectors); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -197,15 +221,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsRouterJobClassifiedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobClassifiedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobClassifiedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobClassifiedEventData(document.RootElement, options); } default: @@ -213,35 +242,28 @@ AcsRouterJobClassifiedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobClassifiedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobClassifiedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobClassifiedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobClassifiedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobClassifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobClassifiedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobClassifiedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs index 6c87513cd751..31e490559c6f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs @@ -17,13 +17,8 @@ public partial class AcsRouterJobClassifiedEventData : AcsRouterJobEventData /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Queue Info. - /// , or is null. internal AcsRouterJobClassifiedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterQueueDetails queueDetails) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - Argument.AssertNotNull(queueDetails, nameof(queueDetails)); - QueueDetails = queueDetails; AttachedWorkerSelectors = new ChangeTrackingList(); } @@ -32,7 +27,7 @@ internal AcsRouterJobClassifiedEventData(IReadOnlyDictionary lab /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. @@ -40,7 +35,7 @@ internal AcsRouterJobClassifiedEventData(IReadOnlyDictionary lab /// Router Job Classification Policy Id. /// Router Job Priority. /// Router Job Attached Worker Selector. - internal AcsRouterJobClassifiedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterQueueDetails queueDetails, string classificationPolicyId, int? priority, IReadOnlyList attachedWorkerSelectors) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobClassifiedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterQueueDetails queueDetails, string classificationPolicyId, int? priority, IReadOnlyList attachedWorkerSelectors) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { QueueDetails = queueDetails; ClassificationPolicyId = classificationPolicyId; @@ -48,17 +43,15 @@ internal AcsRouterJobClassifiedEventData(string jobId, string channelReference, AttachedWorkerSelectors = attachedWorkerSelectors; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobClassifiedEventData() - { - } - /// Router Job Queue Info. public AcsRouterQueueDetails QueueDetails { get; } + /// Router Job Classification Policy Id. public string ClassificationPolicyId { get; } + /// Router Job Priority. public int? Priority { get; } + /// Router Job Attached Worker Selector. public IReadOnlyList AttachedWorkerSelectors { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs index ab9ceb7e8151..be3649f3670d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClosed event. [JsonConverter(typeof(AcsRouterJobClosedEventDataConverter))] - public partial class AcsRouterJobClosedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobClosedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobClosedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobClosedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(AssignmentId)) { @@ -54,105 +58,122 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobClosedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobClosedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobClosedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobClosedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobClosedEventData(document.RootElement, options); } - internal static AcsRouterJobClosedEventData DeserializeAcsRouterJobClosedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobClosedEventData DeserializeAcsRouterJobClosedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string assignmentId = default; - string workerId = default; - string dispositionCode = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + string assignmentId = default; + string workerId = default; + string dispositionCode = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("assignmentId"u8)) + if (prop.NameEquals("jobId"u8)) { - assignmentId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("channelReference"u8)) { - workerId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("dispositionCode"u8)) + if (prop.NameEquals("channelId"u8)) { - dispositionCode = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("queueId"u8)) { - queueId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("assignmentId"u8)) { - jobId = property.Value.GetString(); + assignmentId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("workerId"u8)) { - channelReference = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("dispositionCode"u8)) { - channelId = property.Value.GetString(); + dispositionCode = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobClosedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -161,10 +182,13 @@ internal static AcsRouterJobClosedEventData DeserializeAcsRouterJobClosedEventDa dispositionCode); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -174,15 +198,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AcsRouterJobClosedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobClosedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobClosedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobClosedEventData(document.RootElement, options); } default: @@ -190,35 +219,28 @@ AcsRouterJobClosedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobClosedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobClosedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobClosedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobClosedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobClosedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobClosedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobClosedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs index 6fc530792e27..3b5881dbdf50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs @@ -16,40 +16,34 @@ public partial class AcsRouterJobClosedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobClosedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); } /// Initializes a new instance of . /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Closed Assignment Id. /// Router Job Closed Worker Id. /// Router Job Closed Disposition Code. - internal AcsRouterJobClosedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId, string dispositionCode) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobClosedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId, string dispositionCode) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { AssignmentId = assignmentId; WorkerId = workerId; DispositionCode = dispositionCode; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobClosedEventData() - { - } - /// Router Job Closed Assignment Id. public string AssignmentId { get; } + /// Router Job Closed Worker Id. public string WorkerId { get; } + /// Router Job Closed Disposition Code. public string DispositionCode { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs index f8ca3b65558b..06339c9d06ff 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobCompleted event. [JsonConverter(typeof(AcsRouterJobCompletedEventDataConverter))] - public partial class AcsRouterJobCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobCompletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(AssignmentId)) { @@ -49,99 +53,116 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobCompletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobCompletedEventData(document.RootElement, options); } - internal static AcsRouterJobCompletedEventData DeserializeAcsRouterJobCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobCompletedEventData DeserializeAcsRouterJobCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string assignmentId = default; - string workerId = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + string assignmentId = default; + string workerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("assignmentId"u8)) + if (prop.NameEquals("jobId"u8)) { - assignmentId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("channelReference"u8)) { - workerId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("channelId"u8)) { - queueId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("queueId"u8)) + { + queueId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("assignmentId"u8)) { - channelReference = property.Value.GetString(); + assignmentId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("workerId"u8)) { - channelId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobCompletedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -149,10 +170,13 @@ internal static AcsRouterJobCompletedEventData DeserializeAcsRouterJobCompletedE workerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +186,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - AcsRouterJobCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobCompletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobCompletedEventData(document.RootElement, options); } default: @@ -178,35 +207,28 @@ AcsRouterJobCompletedEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs index bcb67b8d7a6c..17471c7f5c52 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs @@ -16,36 +16,29 @@ public partial class AcsRouterJobCompletedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobCompletedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); } /// Initializes a new instance of . /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Completed Assignment Id. /// Router Job Completed Worker Id. - internal AcsRouterJobCompletedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobCompletedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { AssignmentId = assignmentId; WorkerId = workerId; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobCompletedEventData() - { - } - /// Router Job Completed Assignment Id. public string AssignmentId { get; } + /// Router Job Completed Worker Id. public string WorkerId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs index 01d3d6a15f0a..a70841e3290b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobDeleted event. [JsonConverter(typeof(AcsRouterJobDeletedEventDataConverter))] - public partial class AcsRouterJobDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,105 +35,124 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AcsRouterJobDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobDeletedEventData(document.RootElement, options); } - internal static AcsRouterJobDeletedEventData DeserializeAcsRouterJobDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobDeletedEventData DeserializeAcsRouterJobDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) { - queueId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("channelReference"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - labels = dictionary; + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("channelId"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("queueId"u8)) { - jobId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("labels"u8)) { - channelReference = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + labels = dictionary; continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("tags"u8)) { - channelId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobDeletedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +162,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - AcsRouterJobDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobDeletedEventData(document.RootElement, options); } default: @@ -154,35 +183,28 @@ AcsRouterJobDeletedEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs index 126b1aea8474..ddaacb715407 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs @@ -16,27 +16,19 @@ public partial class AcsRouterJobDeletedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobDeletedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); } /// Initializes a new instance of . /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. - internal AcsRouterJobDeletedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) - { - } - - /// Initializes a new instance of for deserialization. - internal AcsRouterJobDeletedEventData() + internal AcsRouterJobDeletedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs index 3934800aa473..db2fc85feb70 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of all Router Job events. [JsonConverter(typeof(AcsRouterJobEventDataConverter))] - public partial class AcsRouterJobEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { @@ -47,6 +51,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Labels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -55,101 +64,126 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - AcsRouterJobEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobEventData(document.RootElement, options); } - internal static AcsRouterJobEventData DeserializeAcsRouterJobEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobEventData DeserializeAcsRouterJobEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) { - queueId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("channelReference"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - labels = dictionary; + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("channelId"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("queueId"u8)) { - jobId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("labels"u8)) { - channelReference = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + labels = dictionary; continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("tags"u8)) { - channelId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -159,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - AcsRouterJobEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobEventData(document.RootElement, options); } default: @@ -175,35 +214,28 @@ AcsRouterJobEventData IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs index 0d4b12a31a8b..99c0cb081452 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs @@ -16,12 +16,8 @@ public partial class AcsRouterJobEventData : AcsRouterEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - Labels = labels; Tags = tags; } @@ -30,27 +26,18 @@ internal AcsRouterJobEventData(IReadOnlyDictionary labels, IRead /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. - internal AcsRouterJobEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(jobId, channelReference, channelId, serializedAdditionalRawData) + internal AcsRouterJobEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties) { QueueId = queueId; Labels = labels; Tags = tags; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobEventData() - { - } - /// Router Job events Queue Id. public string QueueId { get; } - /// Router Job events Labels. - public IReadOnlyDictionary Labels { get; } - /// Router Jobs events Tags. - public IReadOnlyDictionary Tags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs index 60c5946b32fd..f6da44e15112 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobExceptionTriggered event. [JsonConverter(typeof(AcsRouterJobExceptionTriggeredEventDataConverter))] - public partial class AcsRouterJobExceptionTriggeredEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobExceptionTriggeredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobExceptionTriggeredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobExceptionTriggeredEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(RuleKey)) { @@ -49,99 +53,116 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobExceptionTriggeredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobExceptionTriggeredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobExceptionTriggeredEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobExceptionTriggeredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobExceptionTriggeredEventData(document.RootElement, options); } - internal static AcsRouterJobExceptionTriggeredEventData DeserializeAcsRouterJobExceptionTriggeredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobExceptionTriggeredEventData DeserializeAcsRouterJobExceptionTriggeredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string ruleKey = default; - string exceptionRuleId = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + string ruleKey = default; + string exceptionRuleId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("ruleKey"u8)) + if (prop.NameEquals("jobId"u8)) { - ruleKey = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("exceptionRuleId"u8)) + if (prop.NameEquals("channelReference"u8)) { - exceptionRuleId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("channelId"u8)) { - queueId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("queueId"u8)) + { + queueId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("ruleKey"u8)) { - channelReference = property.Value.GetString(); + ruleKey = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("exceptionRuleId"u8)) { - channelId = property.Value.GetString(); + exceptionRuleId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobExceptionTriggeredEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -149,10 +170,13 @@ internal static AcsRouterJobExceptionTriggeredEventData DeserializeAcsRouterJobE exceptionRuleId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +186,20 @@ BinaryData IPersistableModel.Write(Mode } } - AcsRouterJobExceptionTriggeredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobExceptionTriggeredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobExceptionTriggeredEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobExceptionTriggeredEventData(document.RootElement, options); } default: @@ -178,35 +207,28 @@ AcsRouterJobExceptionTriggeredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobExceptionTriggeredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobExceptionTriggeredEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobExceptionTriggeredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobExceptionTriggeredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobExceptionTriggeredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobExceptionTriggeredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobExceptionTriggeredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs index 9f4aa2bed164..4a8b5bdd1e6f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs @@ -16,36 +16,29 @@ public partial class AcsRouterJobExceptionTriggeredEventData : AcsRouterJobEvent /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobExceptionTriggeredEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); } /// Initializes a new instance of . /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Exception Triggered Rule Key. /// Router Job Exception Triggered Rule Id. - internal AcsRouterJobExceptionTriggeredEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string ruleKey, string exceptionRuleId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobExceptionTriggeredEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string ruleKey, string exceptionRuleId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { RuleKey = ruleKey; ExceptionRuleId = exceptionRuleId; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobExceptionTriggeredEventData() - { - } - /// Router Job Exception Triggered Rule Key. public string RuleKey { get; } + /// Router Job Exception Triggered Rule Id. public string ExceptionRuleId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs index 3b3df53fe151..2b53e685597c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobQueued event. [JsonConverter(typeof(AcsRouterJobQueuedEventDataConverter))] - public partial class AcsRouterJobQueuedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobQueuedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobQueuedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobQueuedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Priority)) { @@ -46,7 +50,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("attachedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in AttachedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in AttachedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -56,7 +60,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("requestedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in RequestedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in RequestedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -64,119 +68,136 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobQueuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobQueuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobQueuedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobQueuedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobQueuedEventData(document.RootElement, options); } - internal static AcsRouterJobQueuedEventData DeserializeAcsRouterJobQueuedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobQueuedEventData DeserializeAcsRouterJobQueuedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - int? priority = default; - IReadOnlyList attachedWorkerSelectors = default; - IReadOnlyList requestedWorkerSelectors = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + int? priority = default; + IReadOnlyList attachedWorkerSelectors = default; + IReadOnlyList requestedWorkerSelectors = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("priority"u8)) + if (prop.NameEquals("jobId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - priority = property.Value.GetInt32(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("attachedWorkerSelectors"u8)) + if (prop.NameEquals("channelReference"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - attachedWorkerSelectors = array; + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("requestedWorkerSelectors"u8)) + if (prop.NameEquals("channelId"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - requestedWorkerSelectors = array; + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("queueId"u8)) { - queueId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("priority"u8)) { - jobId = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = prop.Value.GetInt32(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("attachedWorkerSelectors"u8)) { - channelReference = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + attachedWorkerSelectors = array; continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("requestedWorkerSelectors"u8)) { - channelId = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + requestedWorkerSelectors = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobQueuedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -185,10 +206,13 @@ internal static AcsRouterJobQueuedEventData DeserializeAcsRouterJobQueuedEventDa requestedWorkerSelectors); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -198,15 +222,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AcsRouterJobQueuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobQueuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobQueuedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobQueuedEventData(document.RootElement, options); } default: @@ -214,35 +243,28 @@ AcsRouterJobQueuedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobQueuedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobQueuedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobQueuedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobQueuedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobQueuedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobQueuedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobQueuedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs index 6d1a918f7236..06d410262b96 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs @@ -16,12 +16,8 @@ public partial class AcsRouterJobQueuedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobQueuedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - AttachedWorkerSelectors = new ChangeTrackingList(); RequestedWorkerSelectors = new ChangeTrackingList(); } @@ -30,29 +26,26 @@ internal AcsRouterJobQueuedEventData(IReadOnlyDictionary labels, /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Priority. /// Router Job Queued Attached Worker Selector. /// Router Job Queued Requested Worker Selector. - internal AcsRouterJobQueuedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList attachedWorkerSelectors, IReadOnlyList requestedWorkerSelectors) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobQueuedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList attachedWorkerSelectors, IReadOnlyList requestedWorkerSelectors) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { Priority = priority; AttachedWorkerSelectors = attachedWorkerSelectors; RequestedWorkerSelectors = requestedWorkerSelectors; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobQueuedEventData() - { - } - /// Router Job Priority. public int? Priority { get; } + /// Router Job Queued Attached Worker Selector. public IReadOnlyList AttachedWorkerSelectors { get; } + /// Router Job Queued Requested Worker Selector. public IReadOnlyList RequestedWorkerSelectors { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs index 305b2cec0d51..9c5098a96b6c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobReceived event. [JsonConverter(typeof(AcsRouterJobReceivedEventDataConverter))] - public partial class AcsRouterJobReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobReceivedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobReceivedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Status)) { @@ -56,7 +60,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("requestedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in RequestedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in RequestedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -71,144 +75,161 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteBooleanValue(UnavailableForMatching); } - AcsRouterJobReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobReceivedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobReceivedEventData(document.RootElement, options); } - internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - AcsRouterJobStatus? jobStatus = default; + string jobId = default; + string channelReference = default; + string channelId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + AcsRouterJobStatus? status = default; string classificationPolicyId = default; int? priority = default; IReadOnlyList requestedWorkerSelectors = default; DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; - string jobId = default; - string channelReference = default; - string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("jobStatus"u8)) + if (prop.NameEquals("jobId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - jobStatus = new AcsRouterJobStatus(property.Value.GetString()); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("classificationPolicyId"u8)) + if (prop.NameEquals("channelReference"u8)) { - classificationPolicyId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("priority"u8)) + if (prop.NameEquals("channelId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - priority = property.Value.GetInt32(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestedWorkerSelectors"u8)) + if (prop.NameEquals("queueId"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + queueId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("labels"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } - requestedWorkerSelectors = array; + labels = dictionary; continue; } - if (property.NameEquals("scheduledOn"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) { - continue; + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } - scheduledOn = property.Value.GetDateTimeOffset("O"); + tags = dictionary; continue; } - if (property.NameEquals("unavailableForMatching"u8)) + if (prop.NameEquals("jobStatus"u8)) { - unavailableForMatching = property.Value.GetBoolean(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AcsRouterJobStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("classificationPolicyId"u8)) { - queueId = property.Value.GetString(); + classificationPolicyId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("priority"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + if (prop.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, property0.Value.GetString()); + continue; } - labels = dictionary; + priority = prop.Value.GetInt32(); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("requestedWorkerSelectors"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); } - tags = dictionary; - continue; - } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); + requestedWorkerSelectors = array; continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("scheduledOn"u8)) { - channelReference = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("unavailableForMatching"u8)) { - channelId = property.Value.GetString(); + unavailableForMatching = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobReceivedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, - jobStatus, + status, classificationPolicyId, priority, requestedWorkerSelectors, @@ -216,10 +237,13 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve unavailableForMatching); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -229,15 +253,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AcsRouterJobReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobReceivedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobReceivedEventData(document.RootElement, options); } default: @@ -245,35 +274,28 @@ AcsRouterJobReceivedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs index 2105e9d90f2f..7d156c6ce217 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs @@ -17,12 +17,8 @@ public partial class AcsRouterJobReceivedEventData : AcsRouterJobEventData /// Router Job events Labels. /// Router Jobs events Tags. /// Unavailable For Matching for Router Job Received. - /// or is null. internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, bool unavailableForMatching) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - RequestedWorkerSelectors = new ChangeTrackingList(); UnavailableForMatching = unavailableForMatching; } @@ -31,7 +27,7 @@ internal AcsRouterJobReceivedEventData(IReadOnlyDictionary label /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. @@ -41,7 +37,7 @@ internal AcsRouterJobReceivedEventData(IReadOnlyDictionary label /// Router Job Received Requested Worker Selectors. /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. - internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus? status, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus? status, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { Status = status; ClassificationPolicyId = classificationPolicyId; @@ -51,18 +47,18 @@ internal AcsRouterJobReceivedEventData(string jobId, string channelReference, st UnavailableForMatching = unavailableForMatching; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobReceivedEventData() - { - } /// Router Job Classification Policy Id. public string ClassificationPolicyId { get; } + /// Router Job Priority. public int? Priority { get; } + /// Router Job Received Requested Worker Selectors. public IReadOnlyList RequestedWorkerSelectors { get; } + /// Router Job Received Scheduled Time in UTC. public DateTimeOffset? ScheduledOn { get; } + /// Unavailable For Matching for Router Job Received. public bool UnavailableForMatching { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs index 61ffa5a94cd7..9a5ad660871d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobSchedulingFailed event. [JsonConverter(typeof(AcsRouterJobSchedulingFailedEventDataConverter))] - public partial class AcsRouterJobSchedulingFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobSchedulingFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobSchedulingFailedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobSchedulingFailedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Priority)) { @@ -46,7 +50,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("expiredAttachedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in ExpiredAttachedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in ExpiredAttachedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -56,7 +60,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("expiredRequestedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in ExpiredRequestedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in ExpiredRequestedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -74,135 +78,152 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobSchedulingFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobSchedulingFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobSchedulingFailedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobSchedulingFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobSchedulingFailedEventData(document.RootElement, options); } - internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSchedulingFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSchedulingFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string jobId = default; + string channelReference = default; + string channelId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; DateTimeOffset? scheduledOn = default; string failureReason = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; - string jobId = default; - string channelReference = default; - string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("priority"u8)) + if (prop.NameEquals("jobId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - priority = property.Value.GetInt32(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("expiredAttachedWorkerSelectors"u8)) + if (prop.NameEquals("channelReference"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - expiredAttachedWorkerSelectors = array; + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("expiredRequestedWorkerSelectors"u8)) + if (prop.NameEquals("channelId"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - expiredRequestedWorkerSelectors = array; + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("scheduledOn"u8)) + if (prop.NameEquals("queueId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scheduledOn = property.Value.GetDateTimeOffset("O"); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("failureReason"u8)) + if (prop.NameEquals("labels"u8)) { - failureReason = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + labels = dictionary; continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("tags"u8)) { - queueId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("priority"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + if (prop.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, property0.Value.GetString()); + continue; } - labels = dictionary; + priority = prop.Value.GetInt32(); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("expiredAttachedWorkerSelectors"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); } - tags = dictionary; + expiredAttachedWorkerSelectors = array; continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("expiredRequestedWorkerSelectors"u8)) { - jobId = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + expiredRequestedWorkerSelectors = array; continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("scheduledOn"u8)) { - channelReference = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("failureReason"u8)) { - channelId = property.Value.GetString(); + failureReason = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobSchedulingFailedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -213,10 +234,13 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch failureReason); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -226,15 +250,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsRouterJobSchedulingFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobSchedulingFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobSchedulingFailedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobSchedulingFailedEventData(document.RootElement, options); } default: @@ -242,35 +271,28 @@ AcsRouterJobSchedulingFailedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobSchedulingFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobSchedulingFailedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobSchedulingFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobSchedulingFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobSchedulingFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobSchedulingFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobSchedulingFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs index 603602f62c5b..07aa96441146 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs @@ -16,12 +16,8 @@ public partial class AcsRouterJobSchedulingFailedEventData : AcsRouterJobEventDa /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); } @@ -30,7 +26,7 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. @@ -39,7 +35,7 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Router Job Scheduling Failed Requested Worker Selector Expired. /// Router Job Scheduling Failed Scheduled Time in UTC. /// Router Job Scheduling Failed Reason. - internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, string failureReason) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, string failureReason) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -48,19 +44,18 @@ internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelRefer FailureReason = failureReason; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobSchedulingFailedEventData() - { - } - /// Router Job Priority. public int? Priority { get; } + /// Router Job Scheduling Failed Attached Worker Selector Expired. public IReadOnlyList ExpiredAttachedWorkerSelectors { get; } + /// Router Job Scheduling Failed Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } + /// Router Job Scheduling Failed Scheduled Time in UTC. public DateTimeOffset? ScheduledOn { get; } + /// Router Job Scheduling Failed Reason. public string FailureReason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobStatus.cs index f678137c38b7..a06e358537a5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobStatus.cs @@ -14,68 +14,107 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRouterJobStatus : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AcsRouterJobStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// Router Job Status Pending Classification. private const string PendingClassificationValue = "PendingClassification"; + /// Router Job Status Queued. private const string QueuedValue = "Queued"; + /// Router Job Status Assigned. private const string AssignedValue = "Assigned"; + /// Router Job Status Completed. private const string CompletedValue = "Completed"; + /// Router Job Status Closed. private const string ClosedValue = "Closed"; + /// Router Job Status Cancelled. private const string CancelledValue = "Cancelled"; + /// Router Job Status Classification Failed. private const string ClassificationFailedValue = "ClassificationFailed"; + /// Router Job Status Created. private const string CreatedValue = "Created"; + /// Router Job Status Pending Schedule. private const string PendingScheduleValue = "PendingSchedule"; + /// Router Job Status Scheduled. private const string ScheduledValue = "Scheduled"; + /// Router Job Status Schedule Failed. private const string ScheduleFailedValue = "ScheduleFailed"; + /// Router Job Status Waiting For Activation. private const string WaitingForActivationValue = "WaitingForActivation"; + /// Initializes a new instance of . + /// The value. + /// is null. + public AcsRouterJobStatus(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// Router Job Status Pending Classification. public static AcsRouterJobStatus PendingClassification { get; } = new AcsRouterJobStatus(PendingClassificationValue); + /// Router Job Status Queued. public static AcsRouterJobStatus Queued { get; } = new AcsRouterJobStatus(QueuedValue); + /// Router Job Status Assigned. public static AcsRouterJobStatus Assigned { get; } = new AcsRouterJobStatus(AssignedValue); + /// Router Job Status Completed. public static AcsRouterJobStatus Completed { get; } = new AcsRouterJobStatus(CompletedValue); + /// Router Job Status Closed. public static AcsRouterJobStatus Closed { get; } = new AcsRouterJobStatus(ClosedValue); + /// Router Job Status Cancelled. public static AcsRouterJobStatus Cancelled { get; } = new AcsRouterJobStatus(CancelledValue); + /// Router Job Status Classification Failed. public static AcsRouterJobStatus ClassificationFailed { get; } = new AcsRouterJobStatus(ClassificationFailedValue); + /// Router Job Status Created. public static AcsRouterJobStatus Created { get; } = new AcsRouterJobStatus(CreatedValue); + /// Router Job Status Pending Schedule. public static AcsRouterJobStatus PendingSchedule { get; } = new AcsRouterJobStatus(PendingScheduleValue); + /// Router Job Status Scheduled. public static AcsRouterJobStatus Scheduled { get; } = new AcsRouterJobStatus(ScheduledValue); + /// Router Job Status Schedule Failed. public static AcsRouterJobStatus ScheduleFailed { get; } = new AcsRouterJobStatus(ScheduleFailedValue); + /// Router Job Status Waiting For Activation. public static AcsRouterJobStatus WaitingForActivation { get; } = new AcsRouterJobStatus(WaitingForActivationValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRouterJobStatus left, AcsRouterJobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRouterJobStatus left, AcsRouterJobStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRouterJobStatus(string value) => new AcsRouterJobStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRouterJobStatus?(string value) => value == null ? null : new AcsRouterJobStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRouterJobStatus other && Equals(other); - /// + + /// public bool Equals(AcsRouterJobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs index 2a0d16565a9b..38d3c77ab767 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobUnassigned event. [JsonConverter(typeof(AcsRouterJobUnassignedEventDataConverter))] - public partial class AcsRouterJobUnassignedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobUnassignedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobUnassignedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobUnassignedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(AssignmentId)) { @@ -49,99 +53,116 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobUnassignedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobUnassignedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobUnassignedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobUnassignedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobUnassignedEventData(document.RootElement, options); } - internal static AcsRouterJobUnassignedEventData DeserializeAcsRouterJobUnassignedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobUnassignedEventData DeserializeAcsRouterJobUnassignedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string assignmentId = default; - string workerId = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + string assignmentId = default; + string workerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("assignmentId"u8)) + if (prop.NameEquals("jobId"u8)) { - assignmentId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("channelReference"u8)) { - workerId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("channelId"u8)) { - queueId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("queueId"u8)) + { + queueId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("assignmentId"u8)) { - channelReference = property.Value.GetString(); + assignmentId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("workerId"u8)) { - channelId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobUnassignedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -149,10 +170,13 @@ internal static AcsRouterJobUnassignedEventData DeserializeAcsRouterJobUnassigne workerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +186,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsRouterJobUnassignedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobUnassignedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobUnassignedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobUnassignedEventData(document.RootElement, options); } default: @@ -178,35 +207,28 @@ AcsRouterJobUnassignedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobUnassignedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobUnassignedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobUnassignedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobUnassignedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobUnassignedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobUnassignedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobUnassignedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs index 21e9655d2741..31112920a51c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs @@ -16,36 +16,29 @@ public partial class AcsRouterJobUnassignedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobUnassignedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); } /// Initializes a new instance of . /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Unassigned Assignment Id. /// Router Job Unassigned Worker Id. - internal AcsRouterJobUnassignedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobUnassignedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { AssignmentId = assignmentId; WorkerId = workerId; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobUnassignedEventData() - { - } - /// Router Job Unassigned Assignment Id. public string AssignmentId { get; } + /// Router Job Unassigned Worker Id. public string WorkerId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs index 63e2baee2bd2..94623c041aef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobWaitingForActivation event. [JsonConverter(typeof(AcsRouterJobWaitingForActivationEventDataConverter))] - public partial class AcsRouterJobWaitingForActivationEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobWaitingForActivationEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobWaitingForActivationEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobWaitingForActivationEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Priority)) { @@ -46,7 +50,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("expiredAttachedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in ExpiredAttachedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in ExpiredAttachedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -56,7 +60,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("expiredRequestedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in ExpiredRequestedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in ExpiredRequestedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -71,135 +75,152 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteBooleanValue(UnavailableForMatching); } - AcsRouterJobWaitingForActivationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobWaitingForActivationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobWaitingForActivationEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobWaitingForActivationEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobWaitingForActivationEventData(document.RootElement, options); } - internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJobWaitingForActivationEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJobWaitingForActivationEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string jobId = default; + string channelReference = default; + string channelId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; - string jobId = default; - string channelReference = default; - string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("priority"u8)) + if (prop.NameEquals("jobId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - priority = property.Value.GetInt32(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("expiredAttachedWorkerSelectors"u8)) + if (prop.NameEquals("channelReference"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - expiredAttachedWorkerSelectors = array; + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("expiredRequestedWorkerSelectors"u8)) + if (prop.NameEquals("channelId"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - expiredRequestedWorkerSelectors = array; + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("scheduledOn"u8)) + if (prop.NameEquals("queueId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scheduledOn = property.Value.GetDateTimeOffset("O"); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("unavailableForMatching"u8)) + if (prop.NameEquals("labels"u8)) { - unavailableForMatching = property.Value.GetBoolean(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + labels = dictionary; continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("tags"u8)) { - queueId = property.Value.GetString(); + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + tags = dictionary; continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("priority"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + if (prop.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, property0.Value.GetString()); + continue; } - labels = dictionary; + priority = prop.Value.GetInt32(); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("expiredAttachedWorkerSelectors"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); } - tags = dictionary; + expiredAttachedWorkerSelectors = array; continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("expiredRequestedWorkerSelectors"u8)) { - jobId = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + expiredRequestedWorkerSelectors = array; continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("scheduledOn"u8)) { - channelReference = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("unavailableForMatching"u8)) { - channelId = property.Value.GetString(); + unavailableForMatching = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobWaitingForActivationEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -210,10 +231,13 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo unavailableForMatching); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +247,20 @@ BinaryData IPersistableModel.Write(Mo } } - AcsRouterJobWaitingForActivationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobWaitingForActivationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobWaitingForActivationEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobWaitingForActivationEventData(document.RootElement, options); } default: @@ -239,35 +268,28 @@ AcsRouterJobWaitingForActivationEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobWaitingForActivationEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobWaitingForActivationEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobWaitingForActivationEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobWaitingForActivationEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobWaitingForActivationEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobWaitingForActivationEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobWaitingForActivationEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs index 8c6ba6351ed6..ea81ca47ad07 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs @@ -17,12 +17,8 @@ public partial class AcsRouterJobWaitingForActivationEventData : AcsRouterJobEve /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Waiting For Activation Unavailable For Matching. - /// or is null. internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, bool unavailableForMatching) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); UnavailableForMatching = unavailableForMatching; @@ -32,7 +28,7 @@ internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. @@ -41,7 +37,7 @@ internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary Router Job Waiting For Activation Requested Worker Selector Expired. /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. - internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -50,19 +46,18 @@ internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelR UnavailableForMatching = unavailableForMatching; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobWaitingForActivationEventData() - { - } - /// Router Job Waiting For Activation Priority. public int? Priority { get; } + /// Router Job Waiting For Activation Worker Selector Expired. public IReadOnlyList ExpiredAttachedWorkerSelectors { get; } + /// Router Job Waiting For Activation Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } + /// Router Job Waiting For Activation Scheduled Time in UTC. public DateTimeOffset? ScheduledOn { get; } + /// Router Job Waiting For Activation Unavailable For Matching. public bool UnavailableForMatching { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs index 2470cac08610..0c21724c94f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobWorkerSelectorsExpired event. [JsonConverter(typeof(AcsRouterJobWorkerSelectorsExpiredEventDataConverter))] - public partial class AcsRouterJobWorkerSelectorsExpiredEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterJobWorkerSelectorsExpiredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterJobWorkerSelectorsExpiredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,18 +35,17 @@ void IJsonModel.Write(Utf8JsonWrite /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobWorkerSelectorsExpiredEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (options.Format != "W") { writer.WritePropertyName("expiredRequestedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in ExpiredRequestedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in ExpiredRequestedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -51,7 +55,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("expiredAttachedWorkerSelectors"u8); writer.WriteStartArray(); - foreach (var item in ExpiredAttachedWorkerSelectors) + foreach (AcsRouterWorkerSelector item in ExpiredAttachedWorkerSelectors) { writer.WriteObjectValue(item, options); } @@ -59,109 +63,126 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterJobWorkerSelectorsExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterJobWorkerSelectorsExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterJobWorkerSelectorsExpiredEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterJobWorkerSelectorsExpiredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(document.RootElement, options); } - internal static AcsRouterJobWorkerSelectorsExpiredEventData DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterJobWorkerSelectorsExpiredEventData DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList expiredRequestedWorkerSelectors = default; - IReadOnlyList expiredAttachedWorkerSelectors = default; - string queueId = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string queueId = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; + IReadOnlyList expiredRequestedWorkerSelectors = default; + IReadOnlyList expiredAttachedWorkerSelectors = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredRequestedWorkerSelectors"u8)) + if (prop.NameEquals("jobId"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - expiredRequestedWorkerSelectors = array; + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("expiredAttachedWorkerSelectors"u8)) + if (prop.NameEquals("channelReference"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); - } - expiredAttachedWorkerSelectors = array; + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("channelId"u8)) { - queueId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("queueId"u8)) + { + queueId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("expiredRequestedWorkerSelectors"u8)) { - channelReference = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + expiredRequestedWorkerSelectors = array; continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("expiredAttachedWorkerSelectors"u8)) { - channelId = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item, options)); + } + expiredAttachedWorkerSelectors = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterJobWorkerSelectorsExpiredEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, queueId, labels, tags, @@ -169,10 +190,13 @@ internal static AcsRouterJobWorkerSelectorsExpiredEventData DeserializeAcsRouter expiredAttachedWorkerSelectors); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -182,15 +206,20 @@ BinaryData IPersistableModel.Write( } } - AcsRouterJobWorkerSelectorsExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterJobWorkerSelectorsExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterJobWorkerSelectorsExpiredEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(document.RootElement, options); } default: @@ -198,35 +227,28 @@ AcsRouterJobWorkerSelectorsExpiredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterJobWorkerSelectorsExpiredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterJobWorkerSelectorsExpiredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterJobWorkerSelectorsExpiredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterJobWorkerSelectorsExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs index b9195fb5eec0..c462761fa209 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs @@ -16,12 +16,8 @@ public partial class AcsRouterJobWorkerSelectorsExpiredEventData : AcsRouterJobE /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// or is null. internal AcsRouterJobWorkerSelectorsExpiredEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); } @@ -30,25 +26,21 @@ internal AcsRouterJobWorkerSelectorsExpiredEventData(IReadOnlyDictionary Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Job events Queue Id. /// Router Job events Labels. /// Router Jobs events Tags. /// Router Job Worker Selectors Expired Requested Worker Selectors. /// Router Job Worker Selectors Expired Attached Worker Selectors. - internal AcsRouterJobWorkerSelectorsExpiredEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IReadOnlyList expiredRequestedWorkerSelectors, IReadOnlyList expiredAttachedWorkerSelectors) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobWorkerSelectorsExpiredEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IReadOnlyList expiredRequestedWorkerSelectors, IReadOnlyList expiredAttachedWorkerSelectors) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, queueId, labels, tags) { ExpiredRequestedWorkerSelectors = expiredRequestedWorkerSelectors; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; } - /// Initializes a new instance of for deserialization. - internal AcsRouterJobWorkerSelectorsExpiredEventData() - { - } - /// Router Job Worker Selectors Expired Requested Worker Selectors. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } + /// Router Job Worker Selectors Expired Attached Worker Selectors. public IReadOnlyList ExpiredAttachedWorkerSelectors { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterLabelOperator.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterLabelOperator.cs index 6a90053bf7f6..fb23cbb77974 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterLabelOperator.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterLabelOperator.cs @@ -14,50 +14,77 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRouterLabelOperator : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AcsRouterLabelOperator(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// Router Label Operator Equal. private const string EqualValue = "Equal"; + /// Router Label Operator Not Equal. private const string NotEqualValue = "NotEqual"; + /// Router Label Operator Greater. private const string GreaterValue = "Greater"; + /// Router Label Operator Less. private const string LessValue = "Less"; + /// Router Label Operator Greater than or equal. private const string GreaterThanOrEqualValue = "GreaterThanOrEqual"; + /// Router Label Operator Less than or equal. private const string LessThanOrEqualValue = "LessThanOrEqual"; + /// Initializes a new instance of . + /// The value. + /// is null. + public AcsRouterLabelOperator(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// Router Label Operator Equal. public static AcsRouterLabelOperator Equal { get; } = new AcsRouterLabelOperator(EqualValue); + /// Router Label Operator Not Equal. public static AcsRouterLabelOperator NotEqual { get; } = new AcsRouterLabelOperator(NotEqualValue); + /// Router Label Operator Greater. public static AcsRouterLabelOperator Greater { get; } = new AcsRouterLabelOperator(GreaterValue); + /// Router Label Operator Less. public static AcsRouterLabelOperator Less { get; } = new AcsRouterLabelOperator(LessValue); + /// Router Label Operator Greater than or equal. public static AcsRouterLabelOperator GreaterThanOrEqual { get; } = new AcsRouterLabelOperator(GreaterThanOrEqualValue); + /// Router Label Operator Less than or equal. public static AcsRouterLabelOperator LessThanOrEqual { get; } = new AcsRouterLabelOperator(LessThanOrEqualValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRouterLabelOperator left, AcsRouterLabelOperator right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRouterLabelOperator left, AcsRouterLabelOperator right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRouterLabelOperator(string value) => new AcsRouterLabelOperator(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRouterLabelOperator?(string value) => value == null ? null : new AcsRouterLabelOperator(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRouterLabelOperator other && Equals(other); - /// + + /// public bool Equals(AcsRouterLabelOperator other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs index d8f24ce1c754..79bd4466d0bf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsRouterQueueDetails : IUtf8JsonSerializable, IJsonModel + /// Router Queue Details. + public partial class AcsRouterQueueDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterQueueDetails() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterQueueDetails)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -49,18 +53,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Labels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,66 +78,79 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterQueueDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterQueueDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterQueueDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterQueueDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterQueueDetails(document.RootElement, options); } - internal static AcsRouterQueueDetails DeserializeAcsRouterQueueDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterQueueDetails DeserializeAcsRouterQueueDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; string name = default; - IReadOnlyDictionary labels = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary labels = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRouterQueueDetails(id, name, labels, serializedAdditionalRawData); + return new AcsRouterQueueDetails(id, name, labels, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +160,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - AcsRouterQueueDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterQueueDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterQueueDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterQueueDetails(document.RootElement, options); } default: @@ -154,22 +181,7 @@ AcsRouterQueueDetails IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterQueueDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterQueueDetails(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs index c1c9142e9c3c..2aa15c4f903a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Router Queue Details. public partial class AcsRouterQueueDetails { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Router Queue Labels. - /// is null. - internal AcsRouterQueueDetails(IReadOnlyDictionary labels) + internal AcsRouterQueueDetails(IDictionary labels) { - Argument.AssertNotNull(labels, nameof(labels)); - Labels = labels; } @@ -59,25 +27,22 @@ internal AcsRouterQueueDetails(IReadOnlyDictionary labels) /// Router Queue Id. /// Router Queue Name. /// Router Queue Labels. - /// Keeps track of any properties unknown to the library. - internal AcsRouterQueueDetails(string id, string name, IReadOnlyDictionary labels, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterQueueDetails(string id, string name, IDictionary labels, IDictionary additionalBinaryDataProperties) { Id = id; Name = name; Labels = labels; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsRouterQueueDetails() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Queue Id. public string Id { get; } + /// Router Queue Name. public string Name { get; } + /// Router Queue Labels. - public IReadOnlyDictionary Labels { get; } + public IDictionary Labels { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterUpdatedWorkerProperty.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterUpdatedWorkerProperty.cs index 670a1c711318..70efc91ed8e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterUpdatedWorkerProperty.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterUpdatedWorkerProperty.cs @@ -14,50 +14,77 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRouterUpdatedWorkerProperty : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AcsRouterUpdatedWorkerProperty(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// AvailableForOffers. private const string AvailableForOffersValue = "AvailableForOffers"; + /// TotalCapacity. private const string TotalCapacityValue = "TotalCapacity"; + /// QueueAssignments. private const string QueueAssignmentsValue = "QueueAssignments"; + /// Labels. private const string LabelsValue = "Labels"; + /// Tags. private const string TagsValue = "Tags"; + /// ChannelConfigurations. private const string ChannelConfigurationsValue = "ChannelConfigurations"; + /// Initializes a new instance of . + /// The value. + /// is null. + public AcsRouterUpdatedWorkerProperty(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// AvailableForOffers. public static AcsRouterUpdatedWorkerProperty AvailableForOffers { get; } = new AcsRouterUpdatedWorkerProperty(AvailableForOffersValue); + /// TotalCapacity. public static AcsRouterUpdatedWorkerProperty TotalCapacity { get; } = new AcsRouterUpdatedWorkerProperty(TotalCapacityValue); + /// QueueAssignments. public static AcsRouterUpdatedWorkerProperty QueueAssignments { get; } = new AcsRouterUpdatedWorkerProperty(QueueAssignmentsValue); + /// Labels. public static AcsRouterUpdatedWorkerProperty Labels { get; } = new AcsRouterUpdatedWorkerProperty(LabelsValue); + /// Tags. public static AcsRouterUpdatedWorkerProperty Tags { get; } = new AcsRouterUpdatedWorkerProperty(TagsValue); + /// ChannelConfigurations. public static AcsRouterUpdatedWorkerProperty ChannelConfigurations { get; } = new AcsRouterUpdatedWorkerProperty(ChannelConfigurationsValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRouterUpdatedWorkerProperty left, AcsRouterUpdatedWorkerProperty right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRouterUpdatedWorkerProperty left, AcsRouterUpdatedWorkerProperty right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRouterUpdatedWorkerProperty(string value) => new AcsRouterUpdatedWorkerProperty(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRouterUpdatedWorkerProperty?(string value) => value == null ? null : new AcsRouterUpdatedWorkerProperty(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRouterUpdatedWorkerProperty other && Equals(other); - /// + + /// public bool Equals(AcsRouterUpdatedWorkerProperty other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.Serialization.cs index b4ca768f5701..0a4990a34682 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerDeleted event. [JsonConverter(typeof(AcsRouterWorkerDeletedEventDataConverter))] - public partial class AcsRouterWorkerDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,76 +30,81 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AcsRouterWorkerDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerDeletedEventData(document.RootElement, options); } - internal static AcsRouterWorkerDeletedEventData DeserializeAcsRouterWorkerDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerDeletedEventData DeserializeAcsRouterWorkerDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string workerId = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("jobId"u8)) { - workerId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("channelReference"u8)) { - jobId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("channelId"u8)) { - channelReference = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("workerId"u8)) { - channelId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRouterWorkerDeletedEventData(jobId, channelReference, channelId, serializedAdditionalRawData, workerId); + return new AcsRouterWorkerDeletedEventData(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -109,15 +114,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsRouterWorkerDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerDeletedEventData(document.RootElement, options); } default: @@ -125,35 +135,28 @@ AcsRouterWorkerDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.cs index 038c0af0fb7d..dc9bb9a38373 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeletedEventData.cs @@ -22,9 +22,9 @@ internal AcsRouterWorkerDeletedEventData() /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. - internal AcsRouterWorkerDeletedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerDeletedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.Serialization.cs index 95d1706859a3..6b6de1030c77 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerDeregistered event. [JsonConverter(typeof(AcsRouterWorkerDeregisteredEventDataConverter))] - public partial class AcsRouterWorkerDeregisteredEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerDeregisteredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerDeregisteredEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(WorkerId)) { writer.WritePropertyName("workerId"u8); writer.WriteStringValue(WorkerId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterWorkerDeregisteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerDeregisteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerDeregisteredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerDeregisteredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerDeregisteredEventData(document.RootElement, options); } - internal static AcsRouterWorkerDeregisteredEventData DeserializeAcsRouterWorkerDeregisteredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerDeregisteredEventData DeserializeAcsRouterWorkerDeregisteredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string workerId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("workerId"u8)) { - workerId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRouterWorkerDeregisteredEventData(workerId, serializedAdditionalRawData); + return new AcsRouterWorkerDeregisteredEventData(workerId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - AcsRouterWorkerDeregisteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerDeregisteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerDeregisteredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerDeregisteredEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ AcsRouterWorkerDeregisteredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterWorkerDeregisteredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerDeregisteredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerDeregisteredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerDeregisteredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerDeregisteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerDeregisteredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerDeregisteredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.cs index bc11a21496ed..2d6fdc216d6e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerDeregisteredEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerDeregistered event. public partial class AcsRouterWorkerDeregisteredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsRouterWorkerDeregisteredEventData() @@ -52,11 +23,11 @@ internal AcsRouterWorkerDeregisteredEventData() /// Initializes a new instance of . /// Router Worker Deregistered Worker Id. - /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerDeregisteredEventData(string workerId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterWorkerDeregisteredEventData(string workerId, IDictionary additionalBinaryDataProperties) { WorkerId = workerId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Worker Deregistered Worker Id. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.Serialization.cs index b7dedcd171b6..b59c33df33f4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of all Router Worker events. [JsonConverter(typeof(AcsRouterWorkerEventDataConverter))] - public partial class AcsRouterWorkerEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(WorkerId)) { @@ -44,67 +43,73 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterWorkerEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerEventData(document.RootElement, options); } - internal static AcsRouterWorkerEventData DeserializeAcsRouterWorkerEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerEventData DeserializeAcsRouterWorkerEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string workerId = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("jobId"u8)) { - workerId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("channelReference"u8)) { - jobId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("channelId"u8)) { - channelReference = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("workerId"u8)) { - channelId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsRouterWorkerEventData(jobId, channelReference, channelId, serializedAdditionalRawData, workerId); + return new AcsRouterWorkerEventData(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -114,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - AcsRouterWorkerEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerEventData(document.RootElement, options); } default: @@ -130,35 +140,28 @@ AcsRouterWorkerEventData IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.cs index 3a11277c3050..5879107e2ffb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerEventData.cs @@ -22,9 +22,9 @@ internal AcsRouterWorkerEventData() /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. - internal AcsRouterWorkerEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData) + internal AcsRouterWorkerEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties) { WorkerId = workerId; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs index c70a331da3dc..b727d93aca03 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferAccepted event. [JsonConverter(typeof(AcsRouterWorkerOfferAcceptedEventDataConverter))] - public partial class AcsRouterWorkerOfferAcceptedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerOfferAcceptedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterWorkerOfferAcceptedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferAcceptedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { @@ -62,6 +66,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in WorkerLabels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -70,6 +79,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in WorkerTags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -78,6 +92,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in JobLabels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -86,142 +105,178 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in JobTags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - AcsRouterWorkerOfferAcceptedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerOfferAcceptedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferAcceptedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferAcceptedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerOfferAcceptedEventData(document.RootElement, options); } - internal static AcsRouterWorkerOfferAcceptedEventData DeserializeAcsRouterWorkerOfferAcceptedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerOfferAcceptedEventData DeserializeAcsRouterWorkerOfferAcceptedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string jobId = default; + string channelReference = default; + string channelId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; string queueId = default; string offerId = default; string assignmentId = default; int? jobPriority = default; - IReadOnlyDictionary workerLabels = default; - IReadOnlyDictionary workerTags = default; - IReadOnlyDictionary jobLabels = default; - IReadOnlyDictionary jobTags = default; - string workerId = default; - string jobId = default; - string channelReference = default; - string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary workerLabels = default; + IDictionary workerTags = default; + IDictionary jobLabels = default; + IDictionary jobTags = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) + { + jobId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("channelReference"u8)) + { + channelReference = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("channelId"u8)) + { + channelId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("workerId"u8)) { - queueId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("offerId"u8)) + if (prop.NameEquals("queueId"u8)) { - offerId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("assignmentId"u8)) + if (prop.NameEquals("offerId"u8)) { - assignmentId = property.Value.GetString(); + offerId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobPriority"u8)) + if (prop.NameEquals("assignmentId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + assignmentId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("jobPriority"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - jobPriority = property.Value.GetInt32(); + jobPriority = prop.Value.GetInt32(); continue; } - if (property.NameEquals("workerLabels"u8)) + if (prop.NameEquals("workerLabels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } workerLabels = dictionary; continue; } - if (property.NameEquals("workerTags"u8)) + if (prop.NameEquals("workerTags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } workerTags = dictionary; continue; } - if (property.NameEquals("jobLabels"u8)) + if (prop.NameEquals("jobLabels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } jobLabels = dictionary; continue; } - if (property.NameEquals("jobTags"u8)) + if (prop.NameEquals("jobTags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } jobTags = dictionary; continue; } - if (property.NameEquals("workerId"u8)) - { - workerId = property.Value.GetString(); - continue; - } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) - { - channelReference = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelId"u8)) - { - channelId = property.Value.GetString(); - continue; - } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerOfferAcceptedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, workerId, queueId, offerId, @@ -233,10 +288,13 @@ internal static AcsRouterWorkerOfferAcceptedEventData DeserializeAcsRouterWorker jobTags); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -246,15 +304,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsRouterWorkerOfferAcceptedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerOfferAcceptedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferAcceptedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerOfferAcceptedEventData(document.RootElement, options); } default: @@ -262,35 +325,28 @@ AcsRouterWorkerOfferAcceptedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerOfferAcceptedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerOfferAcceptedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerOfferAcceptedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferAcceptedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerOfferAcceptedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerOfferAcceptedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferAcceptedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs index 8308b2379894..a5e18110bfc9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs @@ -18,14 +18,8 @@ public partial class AcsRouterWorkerOfferAcceptedEventData : AcsRouterWorkerEven /// Router Worker Offer Accepted Worker Tags. /// Router Worker Offer Accepted Job Labels. /// Router Worker Offer Accepted Job Tags. - /// , , or is null. - internal AcsRouterWorkerOfferAcceptedEventData(IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) + internal AcsRouterWorkerOfferAcceptedEventData(IDictionary workerLabels, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) { - Argument.AssertNotNull(workerLabels, nameof(workerLabels)); - Argument.AssertNotNull(workerTags, nameof(workerTags)); - Argument.AssertNotNull(jobLabels, nameof(jobLabels)); - Argument.AssertNotNull(jobTags, nameof(jobTags)); - WorkerLabels = workerLabels; WorkerTags = workerTags; JobLabels = jobLabels; @@ -36,7 +30,7 @@ internal AcsRouterWorkerOfferAcceptedEventData(IReadOnlyDictionary Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. /// Router Worker Offer Accepted Queue Id. /// Router Worker Offer Accepted Offer Id. @@ -46,7 +40,7 @@ internal AcsRouterWorkerOfferAcceptedEventData(IReadOnlyDictionary Router Worker Offer Accepted Worker Tags. /// Router Worker Offer Accepted Job Labels. /// Router Worker Offer Accepted Job Tags. - internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId, string assignmentId, int? jobPriority, IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId, string assignmentId, int? jobPriority, IDictionary workerLabels, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -58,26 +52,28 @@ internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelRefer JobTags = jobTags; } - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerOfferAcceptedEventData() - { - } - /// Router Worker Offer Accepted Queue Id. public string QueueId { get; } + /// Router Worker Offer Accepted Offer Id. public string OfferId { get; } + /// Router Worker Offer Accepted Assignment Id. public string AssignmentId { get; } + /// Router Worker Offer Accepted Job Priority. public int? JobPriority { get; } + /// Router Worker Offer Accepted Worker Labels. - public IReadOnlyDictionary WorkerLabels { get; } + public IDictionary WorkerLabels { get; } + /// Router Worker Offer Accepted Worker Tags. - public IReadOnlyDictionary WorkerTags { get; } + public IDictionary WorkerTags { get; } + /// Router Worker Offer Accepted Job Labels. - public IReadOnlyDictionary JobLabels { get; } + public IDictionary JobLabels { get; } + /// Router Worker Offer Accepted Job Tags. - public IReadOnlyDictionary JobTags { get; } + public IDictionary JobTags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs index b85fb968c7f3..7be63a43b18c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferDeclined event. [JsonConverter(typeof(AcsRouterWorkerOfferDeclinedEventDataConverter))] - public partial class AcsRouterWorkerOfferDeclinedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerOfferDeclinedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferDeclinedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { @@ -49,86 +48,92 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterWorkerOfferDeclinedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerOfferDeclinedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferDeclinedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferDeclinedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerOfferDeclinedEventData(document.RootElement, options); } - internal static AcsRouterWorkerOfferDeclinedEventData DeserializeAcsRouterWorkerOfferDeclinedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerOfferDeclinedEventData DeserializeAcsRouterWorkerOfferDeclinedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string queueId = default; - string offerId = default; - string workerId = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; + string queueId = default; + string offerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) { - queueId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("offerId"u8)) + if (prop.NameEquals("channelReference"u8)) { - offerId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("channelId"u8)) { - workerId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("workerId"u8)) { - jobId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("queueId"u8)) { - channelReference = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("offerId"u8)) { - channelId = property.Value.GetString(); + offerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerOfferDeclinedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, workerId, queueId, offerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsRouterWorkerOfferDeclinedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerOfferDeclinedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferDeclinedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerOfferDeclinedEventData(document.RootElement, options); } default: @@ -154,35 +164,28 @@ AcsRouterWorkerOfferDeclinedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerOfferDeclinedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerOfferDeclinedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerOfferDeclinedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferDeclinedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerOfferDeclinedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerOfferDeclinedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferDeclinedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.cs index 1197ec2176a3..0b92df81591e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferDeclinedEventData.cs @@ -22,11 +22,11 @@ internal AcsRouterWorkerOfferDeclinedEventData() /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. /// Router Worker Offer Declined Queue Id. /// Router Worker Offer Declined Offer Id. - internal AcsRouterWorkerOfferDeclinedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferDeclinedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -34,6 +34,7 @@ internal AcsRouterWorkerOfferDeclinedEventData(string jobId, string channelRefer /// Router Worker Offer Declined Queue Id. public string QueueId { get; } + /// Router Worker Offer Declined Offer Id. public string OfferId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.Serialization.cs index 6522bae6099f..e65126e660cd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferExpired event. [JsonConverter(typeof(AcsRouterWorkerOfferExpiredEventDataConverter))] - public partial class AcsRouterWorkerOfferExpiredEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerOfferExpiredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferExpiredEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { @@ -49,86 +48,92 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterWorkerOfferExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerOfferExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferExpiredEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferExpiredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerOfferExpiredEventData(document.RootElement, options); } - internal static AcsRouterWorkerOfferExpiredEventData DeserializeAcsRouterWorkerOfferExpiredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerOfferExpiredEventData DeserializeAcsRouterWorkerOfferExpiredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string queueId = default; - string offerId = default; - string workerId = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; + string queueId = default; + string offerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) { - queueId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("offerId"u8)) + if (prop.NameEquals("channelReference"u8)) { - offerId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("channelId"u8)) { - workerId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("workerId"u8)) { - jobId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("queueId"u8)) { - channelReference = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("offerId"u8)) { - channelId = property.Value.GetString(); + offerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerOfferExpiredEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, workerId, queueId, offerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - AcsRouterWorkerOfferExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerOfferExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferExpiredEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerOfferExpiredEventData(document.RootElement, options); } default: @@ -154,35 +164,28 @@ AcsRouterWorkerOfferExpiredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerOfferExpiredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerOfferExpiredEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerOfferExpiredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferExpiredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerOfferExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerOfferExpiredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferExpiredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.cs index 2b67e73ec019..a289172689cf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferExpiredEventData.cs @@ -22,11 +22,11 @@ internal AcsRouterWorkerOfferExpiredEventData() /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. /// Router Worker Offer Expired Queue Id. /// Router Worker Offer Expired Offer Id. - internal AcsRouterWorkerOfferExpiredEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferExpiredEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -34,6 +34,7 @@ internal AcsRouterWorkerOfferExpiredEventData(string jobId, string channelRefere /// Router Worker Offer Expired Queue Id. public string QueueId { get; } + /// Router Worker Offer Expired Offer Id. public string OfferId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs index dd33ca78a3cd..03d71e65a27c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferIssued event. [JsonConverter(typeof(AcsRouterWorkerOfferIssuedEventDataConverter))] - public partial class AcsRouterWorkerOfferIssuedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerOfferIssuedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterWorkerOfferIssuedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferIssuedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { @@ -57,6 +61,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in WorkerLabels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -75,6 +84,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in WorkerTags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -83,6 +97,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in JobLabels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -91,156 +110,192 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in JobTags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - AcsRouterWorkerOfferIssuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerOfferIssuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferIssuedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferIssuedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerOfferIssuedEventData(document.RootElement, options); } - internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOfferIssuedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOfferIssuedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string jobId = default; + string channelReference = default; + string channelId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; string queueId = default; string offerId = default; int? jobPriority = default; - IReadOnlyDictionary workerLabels = default; + IDictionary workerLabels = default; DateTimeOffset? offeredOn = default; DateTimeOffset? expiresOn = default; - IReadOnlyDictionary workerTags = default; - IReadOnlyDictionary jobLabels = default; - IReadOnlyDictionary jobTags = default; - string workerId = default; - string jobId = default; - string channelReference = default; - string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary workerTags = default; + IDictionary jobLabels = default; + IDictionary jobTags = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) + { + jobId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("channelReference"u8)) + { + channelReference = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("channelId"u8)) + { + channelId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("workerId"u8)) { - queueId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("offerId"u8)) + if (prop.NameEquals("queueId"u8)) { - offerId = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobPriority"u8)) + if (prop.NameEquals("offerId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + offerId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("jobPriority"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - jobPriority = property.Value.GetInt32(); + jobPriority = prop.Value.GetInt32(); continue; } - if (property.NameEquals("workerLabels"u8)) + if (prop.NameEquals("workerLabels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } workerLabels = dictionary; continue; } - if (property.NameEquals("offeredOn"u8)) + if (prop.NameEquals("offeredOn"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - offeredOn = property.Value.GetDateTimeOffset("O"); + offeredOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("expiresOn"u8)) + if (prop.NameEquals("expiresOn"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - expiresOn = property.Value.GetDateTimeOffset("O"); + expiresOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("workerTags"u8)) + if (prop.NameEquals("workerTags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } workerTags = dictionary; continue; } - if (property.NameEquals("jobLabels"u8)) + if (prop.NameEquals("jobLabels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } jobLabels = dictionary; continue; } - if (property.NameEquals("jobTags"u8)) + if (prop.NameEquals("jobTags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } jobTags = dictionary; continue; } - if (property.NameEquals("workerId"u8)) - { - workerId = property.Value.GetString(); - continue; - } - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelReference"u8)) - { - channelReference = property.Value.GetString(); - continue; - } - if (property.NameEquals("channelId"u8)) - { - channelId = property.Value.GetString(); - continue; - } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerOfferIssuedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, workerId, queueId, offerId, @@ -253,10 +308,13 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf jobTags); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -266,15 +324,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - AcsRouterWorkerOfferIssuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerOfferIssuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferIssuedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerOfferIssuedEventData(document.RootElement, options); } default: @@ -282,35 +345,28 @@ AcsRouterWorkerOfferIssuedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerOfferIssuedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerOfferIssuedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerOfferIssuedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferIssuedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerOfferIssuedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerOfferIssuedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferIssuedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs index ac8aee0106c3..b9e6f0821c1c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs @@ -18,14 +18,8 @@ public partial class AcsRouterWorkerOfferIssuedEventData : AcsRouterWorkerEventD /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. - /// , , or is null. - internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) + internal AcsRouterWorkerOfferIssuedEventData(IDictionary workerLabels, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) { - Argument.AssertNotNull(workerLabels, nameof(workerLabels)); - Argument.AssertNotNull(workerTags, nameof(workerTags)); - Argument.AssertNotNull(jobLabels, nameof(jobLabels)); - Argument.AssertNotNull(jobTags, nameof(jobTags)); - WorkerLabels = workerLabels; WorkerTags = workerTags; JobLabels = jobLabels; @@ -36,7 +30,7 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. /// Router Worker Offer Issued Queue Id. /// Router Worker Offer Issued Offer Id. @@ -47,7 +41,7 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. - internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId, int? jobPriority, IDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -60,28 +54,31 @@ internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReferen JobTags = jobTags; } - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerOfferIssuedEventData() - { - } - /// Router Worker Offer Issued Queue Id. public string QueueId { get; } + /// Router Worker Offer Issued Offer Id. public string OfferId { get; } + /// Router Worker Offer Issued Job Priority. public int? JobPriority { get; } + /// Router Worker Offer Issued Worker Labels. - public IReadOnlyDictionary WorkerLabels { get; } + public IDictionary WorkerLabels { get; } + /// Router Worker Offer Issued Time in UTC. public DateTimeOffset? OfferedOn { get; } + /// Router Worker Offer Issued Expiration Time in UTC. public DateTimeOffset? ExpiresOn { get; } + /// Router Worker Offer Issued Worker Tags. - public IReadOnlyDictionary WorkerTags { get; } + public IDictionary WorkerTags { get; } + /// Router Worker Offer Issued Job Labels. - public IReadOnlyDictionary JobLabels { get; } + public IDictionary JobLabels { get; } + /// Router Worker Offer Issued Job Tags. - public IReadOnlyDictionary JobTags { get; } + public IDictionary JobTags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.Serialization.cs index e195f7f917c4..eb4d4eb56b6c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferRevoked event. [JsonConverter(typeof(AcsRouterWorkerOfferRevokedEventDataConverter))] - public partial class AcsRouterWorkerOfferRevokedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerOfferRevokedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferRevokedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { @@ -49,86 +48,92 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsRouterWorkerOfferRevokedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerOfferRevokedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferRevokedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsRouterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerOfferRevokedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerOfferRevokedEventData(document.RootElement, options); } - internal static AcsRouterWorkerOfferRevokedEventData DeserializeAcsRouterWorkerOfferRevokedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerOfferRevokedEventData DeserializeAcsRouterWorkerOfferRevokedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string queueId = default; - string offerId = default; - string workerId = default; string jobId = default; string channelReference = default; string channelId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string workerId = default; + string queueId = default; + string offerId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queueId"u8)) + if (prop.NameEquals("jobId"u8)) { - queueId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } - if (property.NameEquals("offerId"u8)) + if (prop.NameEquals("channelReference"u8)) { - offerId = property.Value.GetString(); + channelReference = prop.Value.GetString(); continue; } - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("channelId"u8)) { - workerId = property.Value.GetString(); + channelId = prop.Value.GetString(); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("workerId"u8)) { - jobId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelReference"u8)) + if (prop.NameEquals("queueId"u8)) { - channelReference = property.Value.GetString(); + queueId = prop.Value.GetString(); continue; } - if (property.NameEquals("channelId"u8)) + if (prop.NameEquals("offerId"u8)) { - channelId = property.Value.GetString(); + offerId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerOfferRevokedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData, + additionalBinaryDataProperties, workerId, queueId, offerId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - AcsRouterWorkerOfferRevokedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerOfferRevokedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsRouterWorkerOfferRevokedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsRouterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerOfferRevokedEventData(document.RootElement, options); } default: @@ -154,35 +164,28 @@ AcsRouterWorkerOfferRevokedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsRouterWorkerOfferRevokedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerOfferRevokedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerOfferRevokedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferRevokedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerOfferRevokedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerOfferRevokedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferRevokedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.cs index 79f37f345b28..e29c9bd20f36 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferRevokedEventData.cs @@ -22,11 +22,11 @@ internal AcsRouterWorkerOfferRevokedEventData() /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Router Worker events Worker Id. /// Router Worker Offer Revoked Queue Id. /// Router Worker Offer Revoked Offer Id. - internal AcsRouterWorkerOfferRevokedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferRevokedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -34,6 +34,7 @@ internal AcsRouterWorkerOfferRevokedEventData(string jobId, string channelRefere /// Router Worker Offer Revoked Queue Id. public string QueueId { get; } + /// Router Worker Offer Revoked Offer Id. public string OfferId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs index 8506d2ffde23..0b4469011e90 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerRegistered event. [JsonConverter(typeof(AcsRouterWorkerRegisteredEventDataConverter))] - public partial class AcsRouterWorkerRegisteredEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerRegisteredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterWorkerRegisteredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerRegisteredEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(WorkerId)) { writer.WritePropertyName("workerId"u8); @@ -45,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("queueAssignments"u8); writer.WriteStartArray(); - foreach (var item in QueueAssignments) + foreach (AcsRouterQueueDetails item in QueueAssignments) { writer.WriteObjectValue(item, options); } @@ -55,7 +59,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("channelConfigurations"u8); writer.WriteStartArray(); - foreach (var item in ChannelConfigurations) + foreach (AcsRouterChannelConfiguration item in ChannelConfigurations) { writer.WriteObjectValue(item, options); } @@ -71,6 +75,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Labels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -79,18 +88,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +113,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterWorkerRegisteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerRegisteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerRegisteredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerRegisteredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerRegisteredEventData(document.RootElement, options); } - internal static AcsRouterWorkerRegisteredEventData DeserializeAcsRouterWorkerRegisteredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerRegisteredEventData DeserializeAcsRouterWorkerRegisteredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -123,72 +142,84 @@ internal static AcsRouterWorkerRegisteredEventData DeserializeAcsRouterWorkerReg IReadOnlyList queueAssignments = default; IReadOnlyList channelConfigurations = default; int? totalCapacity = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary labels = default; + IDictionary tags = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("workerId"u8)) { - workerId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("queueAssignments"u8)) + if (prop.NameEquals("queueAssignments"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsRouterQueueDetails.DeserializeAcsRouterQueueDetails(item, options)); } queueAssignments = array; continue; } - if (property.NameEquals("channelConfigurations"u8)) + if (prop.NameEquals("channelConfigurations"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsRouterChannelConfiguration.DeserializeAcsRouterChannelConfiguration(item, options)); } channelConfigurations = array; continue; } - if (property.NameEquals("totalCapacity"u8)) + if (prop.NameEquals("totalCapacity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - totalCapacity = property.Value.GetInt32(); + totalCapacity = prop.Value.GetInt32(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerRegisteredEventData( workerId, queueAssignments, @@ -196,13 +227,16 @@ internal static AcsRouterWorkerRegisteredEventData DeserializeAcsRouterWorkerReg totalCapacity, labels, tags, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -212,15 +246,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - AcsRouterWorkerRegisteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerRegisteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerRegisteredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerRegisteredEventData(document.RootElement, options); } default: @@ -228,35 +267,28 @@ AcsRouterWorkerRegisteredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterWorkerRegisteredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerRegisteredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerRegisteredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerRegisteredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerRegisteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerRegisteredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerRegisteredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs index 3f3cc4465551..5dd2f3f33280 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerRegistered event. public partial class AcsRouterWorkerRegisteredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Router Worker Registered Labels. /// Router Worker Registered Tags. - /// or is null. - internal AcsRouterWorkerRegisteredEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) + internal AcsRouterWorkerRegisteredEventData(IDictionary labels, IDictionary tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - QueueAssignments = new ChangeTrackingList(); ChannelConfigurations = new ChangeTrackingList(); Labels = labels; @@ -67,8 +34,8 @@ internal AcsRouterWorkerRegisteredEventData(IReadOnlyDictionary /// Router Worker Register Total Capacity. /// Router Worker Registered Labels. /// Router Worker Registered Tags. - /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IDictionary labels, IDictionary tags, IDictionary additionalBinaryDataProperties) { WorkerId = workerId; QueueAssignments = queueAssignments; @@ -76,25 +43,25 @@ internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList Initializes a new instance of for deserialization. - internal AcsRouterWorkerRegisteredEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Worker Registered Worker Id. public string WorkerId { get; } + /// Router Worker Registered Queue Info. public IReadOnlyList QueueAssignments { get; } + /// Router Worker Registered Channel Configuration. public IReadOnlyList ChannelConfigurations { get; } + /// Router Worker Register Total Capacity. public int? TotalCapacity { get; } + /// Router Worker Registered Labels. - public IReadOnlyDictionary Labels { get; } + public IDictionary Labels { get; } + /// Router Worker Registered Tags. - public IReadOnlyDictionary Tags { get; } + public IDictionary Tags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs index 97c521af46a3..e9f11065cfbc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsRouterWorkerSelector : IUtf8JsonSerializable, IJsonModel + /// Router Job Worker Selector. + public partial class AcsRouterWorkerSelector : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterWorkerSelector() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerSelector)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Key)) { writer.WritePropertyName("key"u8); @@ -58,15 +62,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("expirationTime"u8); writer.WriteStringValue(ExpirationTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,98 +79,104 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterWorkerSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerSelector JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerSelector)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerSelector(document.RootElement, options); } - internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string key = default; - AcsRouterLabelOperator? labelOperator = default; - object value = default; + AcsRouterLabelOperator? @operator = default; + object labelValue = default; double? ttlSeconds = default; - AcsRouterWorkerSelectorState? state = default; + AcsRouterWorkerSelectorState? selectorState = default; DateTimeOffset? expirationTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("key"u8)) + if (prop.NameEquals("key"u8)) { - key = property.Value.GetString(); + key = prop.Value.GetString(); continue; } - if (property.NameEquals("labelOperator"u8)) + if (prop.NameEquals("labelOperator"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - labelOperator = new AcsRouterLabelOperator(property.Value.GetString()); + @operator = new AcsRouterLabelOperator(prop.Value.GetString()); continue; } - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - value = property.Value.GetObject(); + labelValue = prop.Value.GetObject(); continue; } - if (property.NameEquals("ttlSeconds"u8)) + if (prop.NameEquals("ttlSeconds"u8)) { - ttlSeconds = property.Value.GetDouble(); + ttlSeconds = prop.Value.GetDouble(); continue; } - if (property.NameEquals("state"u8)) + if (prop.NameEquals("state"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - state = new AcsRouterWorkerSelectorState(property.Value.GetString()); + selectorState = new AcsRouterWorkerSelectorState(prop.Value.GetString()); continue; } - if (property.NameEquals("expirationTime"u8)) + if (prop.NameEquals("expirationTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - expirationTime = property.Value.GetDateTimeOffset("O"); + expirationTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerSelector( key, - labelOperator, - value, + @operator, + labelValue, ttlSeconds, - state, + selectorState, expirationTime, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -176,15 +186,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - AcsRouterWorkerSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerSelector PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerSelector(document.RootElement, options); } default: @@ -192,22 +207,7 @@ AcsRouterWorkerSelector IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterWorkerSelector FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerSelector(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs index 5a86e6de4efa..661b116f6d24 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs @@ -13,46 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Router Job Worker Selector. public partial class AcsRouterWorkerSelector { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Router Job Worker Selector Value. - /// Router Job Worker Selector Time to Live in Seconds. - /// is null. + /// internal AcsRouterWorkerSelector(object labelValue, double? ttlSeconds) { - Argument.AssertNotNull(labelValue, nameof(labelValue)); - LabelValue = labelValue; TtlSeconds = ttlSeconds; } @@ -61,11 +29,11 @@ internal AcsRouterWorkerSelector(object labelValue, double? ttlSeconds) /// Router Job Worker Selector Key. /// Router Job Worker Selector Label Operator. /// Router Job Worker Selector Value. - /// Router Job Worker Selector Time to Live in Seconds. + /// /// Router Job Worker Selector State. /// Router Job Worker Selector Expiration Time. - /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? @operator, object labelValue, double? ttlSeconds, AcsRouterWorkerSelectorState? selectorState, DateTimeOffset? expirationTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? @operator, object labelValue, double? ttlSeconds, AcsRouterWorkerSelectorState? selectorState, DateTimeOffset? expirationTime, IDictionary additionalBinaryDataProperties) { Key = key; Operator = @operator; @@ -73,16 +41,12 @@ internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? @operator, TtlSeconds = ttlSeconds; SelectorState = selectorState; ExpirationTime = expirationTime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerSelector() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Job Worker Selector Key. public string Key { get; } + /// Router Job Worker Selector Expiration Time. public DateTimeOffset? ExpirationTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelectorState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelectorState.cs index 9a07ed1b9780..474925d06583 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelectorState.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelectorState.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsRouterWorkerSelectorState : IEquatable { private readonly string _value; + /// Router Worker Selector State Active. + private const string ActiveValue = "active"; + /// Router Worker Selector State Expired. + private const string ExpiredValue = "expired"; /// Initializes a new instance of . + /// The value. /// is null. public AcsRouterWorkerSelectorState(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ActiveValue = "active"; - private const string ExpiredValue = "expired"; + _value = value; + } /// Router Worker Selector State Active. public static AcsRouterWorkerSelectorState Active { get; } = new AcsRouterWorkerSelectorState(ActiveValue); + /// Router Worker Selector State Expired. public static AcsRouterWorkerSelectorState Expired { get; } = new AcsRouterWorkerSelectorState(ExpiredValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsRouterWorkerSelectorState left, AcsRouterWorkerSelectorState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsRouterWorkerSelectorState left, AcsRouterWorkerSelectorState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsRouterWorkerSelectorState(string value) => new AcsRouterWorkerSelectorState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsRouterWorkerSelectorState?(string value) => value == null ? null : new AcsRouterWorkerSelectorState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsRouterWorkerSelectorState other && Equals(other); - /// + + /// public bool Equals(AcsRouterWorkerSelectorState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs index 7ee0e5ba784c..a9e3dd84dc00 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerUpdated event. [JsonConverter(typeof(AcsRouterWorkerUpdatedEventDataConverter))] - public partial class AcsRouterWorkerUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsRouterWorkerUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsRouterWorkerUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(WorkerId)) { writer.WritePropertyName("workerId"u8); @@ -45,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("queueAssignments"u8); writer.WriteStartArray(); - foreach (var item in QueueAssignments) + foreach (AcsRouterQueueDetails item in QueueAssignments) { writer.WriteObjectValue(item, options); } @@ -55,7 +59,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("channelConfigurations"u8); writer.WriteStartArray(); - foreach (var item in ChannelConfigurations) + foreach (AcsRouterChannelConfiguration item in ChannelConfigurations) { writer.WriteObjectValue(item, options); } @@ -71,6 +75,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Labels) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -79,6 +88,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -86,21 +100,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("updatedWorkerProperties"u8); writer.WriteStartArray(); - foreach (var item in UpdatedWorkerProperties) + foreach (AcsRouterUpdatedWorkerProperty item in UpdatedWorkerProperties) { writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -109,22 +123,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsRouterWorkerUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsRouterWorkerUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsRouterWorkerUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsRouterWorkerUpdatedEventData(document.RootElement, options); } - internal static AcsRouterWorkerUpdatedEventData DeserializeAcsRouterWorkerUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsRouterWorkerUpdatedEventData DeserializeAcsRouterWorkerUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -133,71 +152,84 @@ internal static AcsRouterWorkerUpdatedEventData DeserializeAcsRouterWorkerUpdate IReadOnlyList queueAssignments = default; IReadOnlyList channelConfigurations = default; int? totalCapacity = default; - IReadOnlyDictionary labels = default; - IReadOnlyDictionary tags = default; + IDictionary labels = default; + IDictionary tags = default; IReadOnlyList updatedWorkerProperties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("workerId"u8)) + if (prop.NameEquals("workerId"u8)) { - workerId = property.Value.GetString(); + workerId = prop.Value.GetString(); continue; } - if (property.NameEquals("queueAssignments"u8)) + if (prop.NameEquals("queueAssignments"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsRouterQueueDetails.DeserializeAcsRouterQueueDetails(item, options)); } queueAssignments = array; continue; } - if (property.NameEquals("channelConfigurations"u8)) + if (prop.NameEquals("channelConfigurations"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(AcsRouterChannelConfiguration.DeserializeAcsRouterChannelConfiguration(item, options)); } channelConfigurations = array; continue; } - if (property.NameEquals("totalCapacity"u8)) + if (prop.NameEquals("totalCapacity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - totalCapacity = property.Value.GetInt32(); + totalCapacity = prop.Value.GetInt32(); continue; } - if (property.NameEquals("labels"u8)) + if (prop.NameEquals("labels"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } labels = dictionary; continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("updatedWorkerProperties"u8)) + if (prop.NameEquals("updatedWorkerProperties"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(new AcsRouterUpdatedWorkerProperty(item.GetString())); } @@ -206,10 +238,9 @@ internal static AcsRouterWorkerUpdatedEventData DeserializeAcsRouterWorkerUpdate } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsRouterWorkerUpdatedEventData( workerId, queueAssignments, @@ -218,13 +249,16 @@ internal static AcsRouterWorkerUpdatedEventData DeserializeAcsRouterWorkerUpdate labels, tags, updatedWorkerProperties, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -234,15 +268,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsRouterWorkerUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsRouterWorkerUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsRouterWorkerUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsRouterWorkerUpdatedEventData(document.RootElement, options); } default: @@ -250,35 +289,28 @@ AcsRouterWorkerUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsRouterWorkerUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsRouterWorkerUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsRouterWorkerUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsRouterWorkerUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsRouterWorkerUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsRouterWorkerUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs index c5ff3fea7cb4..5307b77a48b0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerUpdated event. public partial class AcsRouterWorkerUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Router Worker Updated Labels. /// Router Worker Updated Tags. - /// or is null. - internal AcsRouterWorkerUpdatedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) + internal AcsRouterWorkerUpdatedEventData(IDictionary labels, IDictionary tags) { - Argument.AssertNotNull(labels, nameof(labels)); - Argument.AssertNotNull(tags, nameof(tags)); - QueueAssignments = new ChangeTrackingList(); ChannelConfigurations = new ChangeTrackingList(); Labels = labels; @@ -69,8 +36,8 @@ internal AcsRouterWorkerUpdatedEventData(IReadOnlyDictionary lab /// Router Worker Updated Labels. /// Router Worker Updated Tags. /// Router Worker Properties Updated. - /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerUpdatedEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IReadOnlyList updatedWorkerProperties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsRouterWorkerUpdatedEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IDictionary labels, IDictionary tags, IReadOnlyList updatedWorkerProperties, IDictionary additionalBinaryDataProperties) { WorkerId = workerId; QueueAssignments = queueAssignments; @@ -79,26 +46,27 @@ internal AcsRouterWorkerUpdatedEventData(string workerId, IReadOnlyList Initializes a new instance of for deserialization. - internal AcsRouterWorkerUpdatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Router Worker Updated Worker Id. public string WorkerId { get; } + /// Router Worker Updated Queue Info. public IReadOnlyList QueueAssignments { get; } + /// Router Worker Updated Channel Configuration. public IReadOnlyList ChannelConfigurations { get; } + /// Router Worker Updated Total Capacity. public int? TotalCapacity { get; } + /// Router Worker Updated Labels. - public IReadOnlyDictionary Labels { get; } + public IDictionary Labels { get; } + /// Router Worker Updated Tags. - public IReadOnlyDictionary Tags { get; } + public IDictionary Tags { get; } + /// Router Worker Properties Updated. public IReadOnlyList UpdatedWorkerProperties { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs index 354b3266f645..9a1808933371 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsSmsDeliveryAttemptProperties : IUtf8JsonSerializable, IJsonModel + /// Schema for details of a delivery attempt. + public partial class AcsSmsDeliveryAttemptProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsDeliveryAttemptProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("segmentsFailed"u8); writer.WriteNumberValue(SegmentsFailed.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsSmsDeliveryAttemptProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsSmsDeliveryAttemptProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsSmsDeliveryAttemptProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsDeliveryAttemptProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsSmsDeliveryAttemptProperties(document.RootElement, options); } - internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttemptProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttemptProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,50 +93,51 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt DateTimeOffset? timestamp = default; int? segmentsSucceeded = default; int? segmentsFailed = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("segmentsSucceeded"u8)) + if (prop.NameEquals("segmentsSucceeded"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - segmentsSucceeded = property.Value.GetInt32(); + segmentsSucceeded = prop.Value.GetInt32(); continue; } - if (property.NameEquals("segmentsFailed"u8)) + if (prop.NameEquals("segmentsFailed"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - segmentsFailed = property.Value.GetInt32(); + segmentsFailed = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, serializedAdditionalRawData); + return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -142,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AcsSmsDeliveryAttemptProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsSmsDeliveryAttemptProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsSmsDeliveryAttemptProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsSmsDeliveryAttemptProperties(document.RootElement, options); } default: @@ -158,22 +168,7 @@ AcsSmsDeliveryAttemptProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsSmsDeliveryAttemptProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsSmsDeliveryAttemptProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs index 21453a993a3f..59ebf62fe923 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema for details of a delivery attempt. public partial class AcsSmsDeliveryAttemptProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AcsSmsDeliveryAttemptProperties() @@ -54,19 +25,21 @@ internal AcsSmsDeliveryAttemptProperties() /// TimeStamp when delivery was attempted. /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. - /// Keeps track of any properties unknown to the library. - internal AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; SegmentsSucceeded = segmentsSucceeded; SegmentsFailed = segmentsFailed; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// TimeStamp when delivery was attempted. public DateTimeOffset? Timestamp { get; } + /// Number of segments that were successfully delivered. public int? SegmentsSucceeded { get; } + /// Number of segments whose delivery failed. public int? SegmentsFailed { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs index d149d827818e..7a629211b897 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event. [JsonConverter(typeof(AcsSmsDeliveryReportReceivedEventDataConverter))] - public partial class AcsSmsDeliveryReportReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsSmsDeliveryReportReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsSmsDeliveryReportReceivedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsDeliveryReportReceivedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("deliveryStatus"u8); writer.WriteStringValue(DeliveryStatus); @@ -45,7 +49,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("deliveryAttempts"u8); writer.WriteStartArray(); - foreach (var item in DeliveryAttempts) + foreach (AcsSmsDeliveryAttemptProperties item in DeliveryAttempts) { writer.WriteObjectValue(item, options); } @@ -63,98 +67,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AcsSmsDeliveryReportReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsSmsDeliveryReportReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsSmsDeliveryReportReceivedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsSmsEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsDeliveryReportReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsSmsDeliveryReportReceivedEventData(document.RootElement, options); } - internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryReportReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryReportReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string messageId = default; + string @from = default; + string to = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string deliveryStatus = default; string deliveryStatusDetails = default; IReadOnlyList deliveryAttempts = default; DateTimeOffset? receivedTimestamp = default; string tag = default; - string messageId = default; - string @from = default; - string to = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deliveryStatus"u8)) + if (prop.NameEquals("messageId"u8)) { - deliveryStatus = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("deliveryStatusDetails"u8)) + if (prop.NameEquals("from"u8)) { - deliveryStatusDetails = property.Value.GetString(); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("deliveryAttempts"u8)) + if (prop.NameEquals("to"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AcsSmsDeliveryAttemptProperties.DeserializeAcsSmsDeliveryAttemptProperties(item, options)); - } - deliveryAttempts = array; + to = prop.Value.GetString(); continue; } - if (property.NameEquals("receivedTimestamp"u8)) + if (prop.NameEquals("deliveryStatus"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - receivedTimestamp = property.Value.GetDateTimeOffset("O"); + deliveryStatus = prop.Value.GetString(); continue; } - if (property.NameEquals("tag"u8)) + if (prop.NameEquals("deliveryStatusDetails"u8)) { - tag = property.Value.GetString(); + deliveryStatusDetails = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("deliveryAttempts"u8)) { - messageId = property.Value.GetString(); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(AcsSmsDeliveryAttemptProperties.DeserializeAcsSmsDeliveryAttemptProperties(item, options)); + } + deliveryAttempts = array; continue; } - if (property.NameEquals("from"u8)) + if (prop.NameEquals("receivedTimestamp"u8)) { - @from = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + receivedTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("to"u8)) + if (prop.NameEquals("tag"u8)) { - to = property.Value.GetString(); + tag = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsSmsDeliveryReportReceivedEventData( messageId, @from, to, - serializedAdditionalRawData, + additionalBinaryDataProperties, deliveryStatus, deliveryStatusDetails, deliveryAttempts, @@ -162,10 +169,13 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR tag); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -175,15 +185,20 @@ BinaryData IPersistableModel.Write(ModelR } } - AcsSmsDeliveryReportReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsSmsDeliveryReportReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsSmsDeliveryReportReceivedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsSmsEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsSmsDeliveryReportReceivedEventData(document.RootElement, options); } default: @@ -191,35 +206,28 @@ AcsSmsDeliveryReportReceivedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsSmsDeliveryReportReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsSmsDeliveryReportReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsSmsDeliveryReportReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsSmsDeliveryReportReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsSmsDeliveryReportReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsSmsDeliveryReportReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsSmsDeliveryReportReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs index d7db623a9e57..fe9c2a55407b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs @@ -19,15 +19,8 @@ public partial class AcsSmsDeliveryReportReceivedEventData : AcsSmsEventBaseProp /// The identity of SMS message receiver. /// Status of Delivery. /// Details about Delivery Status. - /// , , , or is null. internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, string deliveryStatus, string deliveryStatusDetails) : base(messageId, @from, to) { - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(@from, nameof(@from)); - Argument.AssertNotNull(to, nameof(to)); - Argument.AssertNotNull(deliveryStatus, nameof(deliveryStatus)); - Argument.AssertNotNull(deliveryStatusDetails, nameof(deliveryStatusDetails)); - DeliveryStatus = deliveryStatus; DeliveryStatusDetails = deliveryStatusDetails; DeliveryAttempts = new ChangeTrackingList(); @@ -37,13 +30,13 @@ internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, s /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Status of Delivery. /// Details about Delivery Status. /// List of details of delivery attempts made. /// The time at which the SMS delivery report was received. /// Customer Content. - internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset? receivedTimestamp, string tag) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, IDictionary additionalBinaryDataProperties, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset? receivedTimestamp, string tag) : base(messageId, @from, to, additionalBinaryDataProperties) { DeliveryStatus = deliveryStatus; DeliveryStatusDetails = deliveryStatusDetails; @@ -52,19 +45,18 @@ internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, s Tag = tag; } - /// Initializes a new instance of for deserialization. - internal AcsSmsDeliveryReportReceivedEventData() - { - } - /// Status of Delivery. public string DeliveryStatus { get; } + /// Details about Delivery Status. public string DeliveryStatusDetails { get; } + /// List of details of delivery attempts made. public IReadOnlyList DeliveryAttempts { get; } + /// The time at which the SMS delivery report was received. public DateTimeOffset? ReceivedTimestamp { get; } + /// Customer Content. public string Tag { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.Serialization.cs index 46b7ed110e39..15627fa01723 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AcsSmsEventBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of common properties of all SMS events. + public partial class AcsSmsEventBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsSmsEventBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,27 +33,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsEventBaseProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); writer.WritePropertyName("from"u8); writer.WriteStringValue(From); writer.WritePropertyName("to"u8); writer.WriteStringValue(To); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,22 +61,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsSmsEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsSmsEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsSmsEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsEventBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsSmsEventBaseProperties(document.RootElement, options); } - internal static AcsSmsEventBaseProperties DeserializeAcsSmsEventBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsSmsEventBaseProperties DeserializeAcsSmsEventBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -80,38 +89,39 @@ internal static AcsSmsEventBaseProperties DeserializeAcsSmsEventBaseProperties(J string messageId = default; string @from = default; string to = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("messageId"u8)) { - messageId = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("from"u8)) + if (prop.NameEquals("from"u8)) { - @from = property.Value.GetString(); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("to"u8)) + if (prop.NameEquals("to"u8)) { - to = property.Value.GetString(); + to = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsSmsEventBaseProperties(messageId, @from, to, serializedAdditionalRawData); + return new AcsSmsEventBaseProperties(messageId, @from, to, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -121,15 +131,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - AcsSmsEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsSmsEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsSmsEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsSmsEventBaseProperties(document.RootElement, options); } default: @@ -137,22 +152,7 @@ AcsSmsEventBaseProperties IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsSmsEventBaseProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsSmsEventBaseProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.cs index 708a8d6e8af0..381d22dae7c4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsEventBaseProperties.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of all SMS events. public partial class AcsSmsEventBaseProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. - /// , or is null. internal AcsSmsEventBaseProperties(string messageId, string @from, string to) { - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(@from, nameof(@from)); - Argument.AssertNotNull(to, nameof(to)); - MessageId = messageId; From = @from; To = to; @@ -65,24 +31,21 @@ internal AcsSmsEventBaseProperties(string messageId, string @from, string to) /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. - /// Keeps track of any properties unknown to the library. - internal AcsSmsEventBaseProperties(string messageId, string @from, string to, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsSmsEventBaseProperties(string messageId, string @from, string to, IDictionary additionalBinaryDataProperties) { MessageId = messageId; From = @from; To = to; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsSmsEventBaseProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The identity of the SMS message. public string MessageId { get; } + /// The identity of SMS message sender. public string From { get; } + /// The identity of SMS message receiver. public string To { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs index 9e908b6d578e..044f55f8f1e7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event. [JsonConverter(typeof(AcsSmsReceivedEventDataConverter))] - public partial class AcsSmsReceivedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsSmsReceivedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsSmsReceivedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsReceivedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); @@ -48,90 +52,96 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteNumberValue(SegmentCount); } - AcsSmsReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsSmsReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AcsSmsReceivedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AcsSmsEventBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsSmsReceivedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsSmsReceivedEventData(document.RootElement, options); } - internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string message = default; - DateTimeOffset? receivedTimestamp = default; - int segmentCount = default; string messageId = default; string @from = default; string to = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string message = default; + DateTimeOffset? receivedTimestamp = default; + int segmentCount = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("message"u8)) + if (prop.NameEquals("messageId"u8)) { - message = property.Value.GetString(); + messageId = prop.Value.GetString(); continue; } - if (property.NameEquals("receivedTimestamp"u8)) + if (prop.NameEquals("from"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - receivedTimestamp = property.Value.GetDateTimeOffset("O"); + @from = prop.Value.GetString(); continue; } - if (property.NameEquals("segmentCount"u8)) + if (prop.NameEquals("to"u8)) { - segmentCount = property.Value.GetInt32(); + to = prop.Value.GetString(); continue; } - if (property.NameEquals("messageId"u8)) + if (prop.NameEquals("message"u8)) { - messageId = property.Value.GetString(); + message = prop.Value.GetString(); continue; } - if (property.NameEquals("from"u8)) + if (prop.NameEquals("receivedTimestamp"u8)) { - @from = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + receivedTimestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("to"u8)) + if (prop.NameEquals("segmentCount"u8)) { - to = property.Value.GetString(); + segmentCount = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AcsSmsReceivedEventData( messageId, @from, to, - serializedAdditionalRawData, + additionalBinaryDataProperties, message, receivedTimestamp, segmentCount); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -141,15 +151,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - AcsSmsReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsSmsReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AcsSmsReceivedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AcsSmsEventBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsSmsReceivedEventData(document.RootElement, options); } default: @@ -157,35 +172,28 @@ AcsSmsReceivedEventData IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AcsSmsReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsSmsReceivedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsSmsReceivedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsSmsReceivedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsSmsReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsSmsReceivedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsSmsReceivedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs index 04f01461c805..3623b9602448 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs @@ -19,14 +19,8 @@ public partial class AcsSmsReceivedEventData : AcsSmsEventBaseProperties /// The identity of SMS message receiver. /// The SMS content. /// Number of segments in the message. - /// , , or is null. internal AcsSmsReceivedEventData(string messageId, string @from, string to, string message, int segmentCount) : base(messageId, @from, to) { - Argument.AssertNotNull(messageId, nameof(messageId)); - Argument.AssertNotNull(@from, nameof(@from)); - Argument.AssertNotNull(to, nameof(to)); - Argument.AssertNotNull(message, nameof(message)); - Message = message; SegmentCount = segmentCount; } @@ -35,26 +29,23 @@ internal AcsSmsReceivedEventData(string messageId, string @from, string to, stri /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The SMS content. /// The time at which the SMS was received. /// Number of segments in the message. - internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset? receivedTimestamp, int segmentCount) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary additionalBinaryDataProperties, string message, DateTimeOffset? receivedTimestamp, int segmentCount) : base(messageId, @from, to, additionalBinaryDataProperties) { Message = message; ReceivedTimestamp = receivedTimestamp; SegmentCount = segmentCount; } - /// Initializes a new instance of for deserialization. - internal AcsSmsReceivedEventData() - { - } - /// The SMS content. public string Message { get; } + /// The time at which the SMS was received. public DateTimeOffset? ReceivedTimestamp { get; } + /// Number of segments in the message. public int SegmentCount { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.Serialization.cs index 0249cf3a34b3..d711d3c7c20a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event. [JsonConverter(typeof(AcsUserDisconnectedEventDataConverter))] - public partial class AcsUserDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AcsUserDisconnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AcsUserDisconnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,23 +35,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsUserDisconnectedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("userCommunicationIdentifier"u8); writer.WriteObjectValue(UserCommunicationIdentifier, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,49 +59,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AcsUserDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AcsUserDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AcsUserDisconnectedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AcsUserDisconnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAcsUserDisconnectedEventData(document.RootElement, options); } - internal static AcsUserDisconnectedEventData DeserializeAcsUserDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AcsUserDisconnectedEventData DeserializeAcsUserDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } CommunicationIdentifierModel userCommunicationIdentifier = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("userCommunicationIdentifier"u8)) + if (prop.NameEquals("userCommunicationIdentifier"u8)) { - userCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + userCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AcsUserDisconnectedEventData(userCommunicationIdentifier, serializedAdditionalRawData); + return new AcsUserDisconnectedEventData(userCommunicationIdentifier, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +117,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - AcsUserDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AcsUserDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AcsUserDisconnectedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAcsUserDisconnectedEventData(document.RootElement, options); } default: @@ -123,35 +138,28 @@ AcsUserDisconnectedEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AcsUserDisconnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAcsUserDisconnectedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AcsUserDisconnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AcsUserDisconnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AcsUserDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAcsUserDisconnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsUserDisconnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.cs index 5dcfa4a59766..28408ea9cd52 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserDisconnectedEventData.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event. public partial class AcsUserDisconnectedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The communication identifier of the user who was disconnected. - /// is null. internal AcsUserDisconnectedEventData(CommunicationIdentifierModel userCommunicationIdentifier) { - Argument.AssertNotNull(userCommunicationIdentifier, nameof(userCommunicationIdentifier)); - UserCommunicationIdentifier = userCommunicationIdentifier; } /// Initializes a new instance of . /// The communication identifier of the user who was disconnected. - /// Keeps track of any properties unknown to the library. - internal AcsUserDisconnectedEventData(CommunicationIdentifierModel userCommunicationIdentifier, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AcsUserDisconnectedEventData(CommunicationIdentifierModel userCommunicationIdentifier, IDictionary additionalBinaryDataProperties) { UserCommunicationIdentifier = userCommunicationIdentifier; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AcsUserDisconnectedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The communication identifier of the user who was disconnected. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserEngagement.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserEngagement.cs index 81dfd6b3ee1b..84e99aee80a0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserEngagement.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsUserEngagement.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AcsUserEngagement : IEquatable { private readonly string _value; + /// View. + private const string ViewValue = "view"; + /// Click. + private const string ClickValue = "click"; /// Initializes a new instance of . + /// The value. /// is null. public AcsUserEngagement(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ViewValue = "view"; - private const string ClickValue = "click"; + _value = value; + } /// View. public static AcsUserEngagement View { get; } = new AcsUserEngagement(ViewValue); + /// Click. public static AcsUserEngagement Click { get; } = new AcsUserEngagement(ClickValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AcsUserEngagement left, AcsUserEngagement right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AcsUserEngagement left, AcsUserEngagement right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AcsUserEngagement(string value) => new AcsUserEngagement(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AcsUserEngagement?(string value) => value == null ? null : new AcsUserEngagement(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AcsUserEngagement other && Equals(other); - /// + + /// public bool Equals(AcsUserEngagement other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.Serialization.cs index 7d2e0934980d..ed051d360cf9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionAdded event. [JsonConverter(typeof(ApiCenterApiDefinitionAddedEventDataConverter))] - public partial class ApiCenterApiDefinitionAddedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiCenterApiDefinitionAddedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiCenterApiDefinitionAddedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiCenterApiDefinitionAddedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); if (Optional.IsDefined(Description)) @@ -48,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("specification"u8); writer.WriteObjectValue(Specification, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -65,22 +69,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiCenterApiDefinitionAddedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiCenterApiDefinitionAddedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiCenterApiDefinitionAddedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiCenterApiDefinitionAddedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiCenterApiDefinitionAddedEventData(document.RootElement, options); } - internal static ApiCenterApiDefinitionAddedEventData DeserializeApiCenterApiDefinitionAddedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiCenterApiDefinitionAddedEventData DeserializeApiCenterApiDefinitionAddedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,42 +97,43 @@ internal static ApiCenterApiDefinitionAddedEventData DeserializeApiCenterApiDefi string title = default; string description = default; ApiCenterApiSpecification specification = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("title"u8)) + if (prop.NameEquals("title"u8)) { - title = property.Value.GetString(); + title = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("specification"u8)) + if (prop.NameEquals("specification"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - specification = ApiCenterApiSpecification.DeserializeApiCenterApiSpecification(property.Value, options); + specification = ApiCenterApiSpecification.DeserializeApiCenterApiSpecification(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiCenterApiDefinitionAddedEventData(title, description, specification, serializedAdditionalRawData); + return new ApiCenterApiDefinitionAddedEventData(title, description, specification, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiCenterApiDefinitionAddedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiCenterApiDefinitionAddedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiCenterApiDefinitionAddedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiCenterApiDefinitionAddedEventData(document.RootElement, options); } default: @@ -149,35 +164,28 @@ ApiCenterApiDefinitionAddedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiCenterApiDefinitionAddedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiCenterApiDefinitionAddedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiCenterApiDefinitionAddedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiCenterApiDefinitionAddedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiCenterApiDefinitionAddedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiCenterApiDefinitionAddedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiCenterApiDefinitionAddedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.cs index f5920be20c66..fab0cab2671c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionAdded event. public partial class ApiCenterApiDefinitionAddedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// API definition title. - /// is null. internal ApiCenterApiDefinitionAddedEventData(string title) { - Argument.AssertNotNull(title, nameof(title)); - Title = title; } @@ -59,24 +27,21 @@ internal ApiCenterApiDefinitionAddedEventData(string title) /// API definition title. /// API definition description. /// API definition specification. - /// Keeps track of any properties unknown to the library. - internal ApiCenterApiDefinitionAddedEventData(string title, string description, ApiCenterApiSpecification specification, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiCenterApiDefinitionAddedEventData(string title, string description, ApiCenterApiSpecification specification, IDictionary additionalBinaryDataProperties) { Title = title; Description = description; Specification = specification; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiCenterApiDefinitionAddedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// API definition title. public string Title { get; } + /// API definition description. public string Description { get; } + /// API definition specification. public ApiCenterApiSpecification Specification { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.Serialization.cs index f3d3df1f8b55..4cfad08a7e6d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionUpdated event. [JsonConverter(typeof(ApiCenterApiDefinitionUpdatedEventDataConverter))] - public partial class ApiCenterApiDefinitionUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiCenterApiDefinitionUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiCenterApiDefinitionUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiCenterApiDefinitionUpdatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); if (Optional.IsDefined(Description)) @@ -48,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("specification"u8); writer.WriteObjectValue(Specification, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -65,22 +69,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiCenterApiDefinitionUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiCenterApiDefinitionUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiCenterApiDefinitionUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiCenterApiDefinitionUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiCenterApiDefinitionUpdatedEventData(document.RootElement, options); } - internal static ApiCenterApiDefinitionUpdatedEventData DeserializeApiCenterApiDefinitionUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiCenterApiDefinitionUpdatedEventData DeserializeApiCenterApiDefinitionUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,42 +97,43 @@ internal static ApiCenterApiDefinitionUpdatedEventData DeserializeApiCenterApiDe string title = default; string description = default; ApiCenterApiSpecification specification = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("title"u8)) + if (prop.NameEquals("title"u8)) { - title = property.Value.GetString(); + title = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("specification"u8)) + if (prop.NameEquals("specification"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - specification = ApiCenterApiSpecification.DeserializeApiCenterApiSpecification(property.Value, options); + specification = ApiCenterApiSpecification.DeserializeApiCenterApiSpecification(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiCenterApiDefinitionUpdatedEventData(title, description, specification, serializedAdditionalRawData); + return new ApiCenterApiDefinitionUpdatedEventData(title, description, specification, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +143,20 @@ BinaryData IPersistableModel.Write(Model } } - ApiCenterApiDefinitionUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiCenterApiDefinitionUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiCenterApiDefinitionUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiCenterApiDefinitionUpdatedEventData(document.RootElement, options); } default: @@ -149,35 +164,28 @@ ApiCenterApiDefinitionUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiCenterApiDefinitionUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiCenterApiDefinitionUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiCenterApiDefinitionUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiCenterApiDefinitionUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiCenterApiDefinitionUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiCenterApiDefinitionUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiCenterApiDefinitionUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.cs index 86329b11c419..0afbeb03b9c7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionUpdated event. public partial class ApiCenterApiDefinitionUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// API definition title. - /// is null. internal ApiCenterApiDefinitionUpdatedEventData(string title) { - Argument.AssertNotNull(title, nameof(title)); - Title = title; } @@ -59,24 +27,21 @@ internal ApiCenterApiDefinitionUpdatedEventData(string title) /// API definition title. /// API definition description. /// API definition specification. - /// Keeps track of any properties unknown to the library. - internal ApiCenterApiDefinitionUpdatedEventData(string title, string description, ApiCenterApiSpecification specification, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiCenterApiDefinitionUpdatedEventData(string title, string description, ApiCenterApiSpecification specification, IDictionary additionalBinaryDataProperties) { Title = title; Description = description; Specification = specification; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiCenterApiDefinitionUpdatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// API definition title. public string Title { get; } + /// API definition description. public string Description { get; } + /// API definition specification. public ApiCenterApiSpecification Specification { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.Serialization.cs index d27097764101..676408f55fcd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ApiCenterApiSpecification : IUtf8JsonSerializable, IJsonModel + /// API specification details. + public partial class ApiCenterApiSpecification : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiCenterApiSpecification() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiCenterApiSpecification)} does not support writing '{format}' format."); } - writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Version)) @@ -41,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("version"u8); writer.WriteStringValue(Version); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,55 +62,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiCenterApiSpecification IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiCenterApiSpecification IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiCenterApiSpecification JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiCenterApiSpecification)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiCenterApiSpecification(document.RootElement, options); } - internal static ApiCenterApiSpecification DeserializeApiCenterApiSpecification(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiCenterApiSpecification DeserializeApiCenterApiSpecification(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; string version = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiCenterApiSpecification(name, version, serializedAdditionalRawData); + return new ApiCenterApiSpecification(name, version, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -116,15 +126,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - ApiCenterApiSpecification IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiCenterApiSpecification IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiCenterApiSpecification PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiCenterApiSpecification(document.RootElement, options); } default: @@ -132,22 +147,7 @@ ApiCenterApiSpecification IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiCenterApiSpecification FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiCenterApiSpecification(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.cs index 3e357444901a..ae864b0a6942 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.cs @@ -13,66 +13,30 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// API specification details. public partial class ApiCenterApiSpecification { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Specification name. - /// is null. internal ApiCenterApiSpecification(string name) { - Argument.AssertNotNull(name, nameof(name)); - Name = name; } /// Initializes a new instance of . /// Specification name. /// Specification version. - /// Keeps track of any properties unknown to the library. - internal ApiCenterApiSpecification(string name, string version, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiCenterApiSpecification(string name, string version, IDictionary additionalBinaryDataProperties) { Name = name; Version = version; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiCenterApiSpecification() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Specification name. public string Name { get; } + /// Specification version. public string Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.Serialization.cs index 259874cc4192..d0a28d18dde9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event. [JsonConverter(typeof(ApiManagementApiCreatedEventDataConverter))] - public partial class ApiManagementApiCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementApiCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementApiCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementApiCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementApiCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementApiCreatedEventData(document.RootElement, options); } - internal static ApiManagementApiCreatedEventData DeserializeApiManagementApiCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementApiCreatedEventData DeserializeApiManagementApiCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementApiCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementApiCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - ApiManagementApiCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementApiCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementApiCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementApiCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementApiCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementApiCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementApiCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementApiCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementApiCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementApiCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementApiCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementApiCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.cs index 749dcc764d1e..862f766709d9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event. public partial class ApiManagementApiCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementApiCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementApiCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementApiCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementApiCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.Serialization.cs index 4f386e59e43e..d0fe2db1c63c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event. [JsonConverter(typeof(ApiManagementApiDeletedEventDataConverter))] - public partial class ApiManagementApiDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementApiDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementApiDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementApiDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementApiDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementApiDeletedEventData(document.RootElement, options); } - internal static ApiManagementApiDeletedEventData DeserializeApiManagementApiDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementApiDeletedEventData DeserializeApiManagementApiDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementApiDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementApiDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - ApiManagementApiDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementApiDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementApiDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementApiDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementApiDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementApiDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementApiDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementApiDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementApiDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementApiDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementApiDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementApiDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.cs index ee98592a9300..7924e424d33e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event. public partial class ApiManagementApiDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementApiDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementApiDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementApiDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementApiDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.Serialization.cs index a8de368a057c..403055b9c935 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event. [JsonConverter(typeof(ApiManagementApiReleaseCreatedEventDataConverter))] - public partial class ApiManagementApiReleaseCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementApiReleaseCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiReleaseCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementApiReleaseCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementApiReleaseCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementApiReleaseCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiReleaseCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementApiReleaseCreatedEventData(document.RootElement, options); } - internal static ApiManagementApiReleaseCreatedEventData DeserializeApiManagementApiReleaseCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementApiReleaseCreatedEventData DeserializeApiManagementApiReleaseCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementApiReleaseCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementApiReleaseCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mode } } - ApiManagementApiReleaseCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementApiReleaseCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementApiReleaseCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementApiReleaseCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementApiReleaseCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementApiReleaseCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementApiReleaseCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementApiReleaseCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementApiReleaseCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementApiReleaseCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementApiReleaseCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementApiReleaseCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.cs index a1fd2b32ca6a..d4e46a968054 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event. public partial class ApiManagementApiReleaseCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementApiReleaseCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementApiReleaseCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementApiReleaseCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementApiReleaseCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.Serialization.cs index 70d85035edc7..4c8925fcf347 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event. [JsonConverter(typeof(ApiManagementApiReleaseDeletedEventDataConverter))] - public partial class ApiManagementApiReleaseDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementApiReleaseDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiReleaseDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementApiReleaseDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementApiReleaseDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementApiReleaseDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiReleaseDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementApiReleaseDeletedEventData(document.RootElement, options); } - internal static ApiManagementApiReleaseDeletedEventData DeserializeApiManagementApiReleaseDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementApiReleaseDeletedEventData DeserializeApiManagementApiReleaseDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementApiReleaseDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementApiReleaseDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mode } } - ApiManagementApiReleaseDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementApiReleaseDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementApiReleaseDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementApiReleaseDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementApiReleaseDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementApiReleaseDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementApiReleaseDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementApiReleaseDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementApiReleaseDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementApiReleaseDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementApiReleaseDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementApiReleaseDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.cs index d6a29916552f..0853aa22819c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event. public partial class ApiManagementApiReleaseDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementApiReleaseDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementApiReleaseDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementApiReleaseDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementApiReleaseDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.Serialization.cs index 73f45e6eab55..887dcc24cede 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event. [JsonConverter(typeof(ApiManagementApiReleaseUpdatedEventDataConverter))] - public partial class ApiManagementApiReleaseUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementApiReleaseUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiReleaseUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementApiReleaseUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementApiReleaseUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementApiReleaseUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiReleaseUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementApiReleaseUpdatedEventData(document.RootElement, options); } - internal static ApiManagementApiReleaseUpdatedEventData DeserializeApiManagementApiReleaseUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementApiReleaseUpdatedEventData DeserializeApiManagementApiReleaseUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementApiReleaseUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementApiReleaseUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mode } } - ApiManagementApiReleaseUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementApiReleaseUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementApiReleaseUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementApiReleaseUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementApiReleaseUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementApiReleaseUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementApiReleaseUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementApiReleaseUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementApiReleaseUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementApiReleaseUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementApiReleaseUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementApiReleaseUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.cs index 21ecd54e9cf9..c80ee96d6d74 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiReleaseUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event. public partial class ApiManagementApiReleaseUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementApiReleaseUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementApiReleaseUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementApiReleaseUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementApiReleaseUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.Serialization.cs index 3e95c8fd1a50..127d016845df 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event. [JsonConverter(typeof(ApiManagementApiUpdatedEventDataConverter))] - public partial class ApiManagementApiUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementApiUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementApiUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementApiUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementApiUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementApiUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementApiUpdatedEventData(document.RootElement, options); } - internal static ApiManagementApiUpdatedEventData DeserializeApiManagementApiUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementApiUpdatedEventData DeserializeApiManagementApiUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementApiUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementApiUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - ApiManagementApiUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementApiUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementApiUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementApiUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementApiUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementApiUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementApiUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementApiUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementApiUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementApiUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementApiUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementApiUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.cs index 6f7d3444dd2a..c212920a45d1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementApiUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event. public partial class ApiManagementApiUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementApiUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementApiUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementApiUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementApiUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.Serialization.cs index 131264f5bb2f..f12028a03186 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.CircuitBreaker.Closed event. [JsonConverter(typeof(ApiManagementCircuitBreakerClosedEventDataConverter))] - public partial class ApiManagementCircuitBreakerClosedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementCircuitBreakerClosedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiManagementCircuitBreakerClosedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,25 +35,24 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementCircuitBreakerClosedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("backendName"u8); writer.WriteStringValue(BackendName); writer.WritePropertyName("circuitBreaker"u8); writer.WriteObjectValue(CircuitBreaker, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementCircuitBreakerClosedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementCircuitBreakerClosedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementCircuitBreakerClosedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementCircuitBreakerClosedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementCircuitBreakerClosedEventData(document.RootElement, options); } - internal static ApiManagementCircuitBreakerClosedEventData DeserializeApiManagementCircuitBreakerClosedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementCircuitBreakerClosedEventData DeserializeApiManagementCircuitBreakerClosedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string backendName = default; ApiManagementCircuitBreakerProperties circuitBreaker = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("backendName"u8)) + if (prop.NameEquals("backendName"u8)) { - backendName = property.Value.GetString(); + backendName = prop.Value.GetString(); continue; } - if (property.NameEquals("circuitBreaker"u8)) + if (prop.NameEquals("circuitBreaker"u8)) { - circuitBreaker = ApiManagementCircuitBreakerProperties.DeserializeApiManagementCircuitBreakerProperties(property.Value, options); + circuitBreaker = ApiManagementCircuitBreakerProperties.DeserializeApiManagementCircuitBreakerProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementCircuitBreakerClosedEventData(backendName, circuitBreaker, serializedAdditionalRawData); + return new ApiManagementCircuitBreakerClosedEventData(backendName, circuitBreaker, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -115,15 +125,20 @@ BinaryData IPersistableModel.Write(M } } - ApiManagementCircuitBreakerClosedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementCircuitBreakerClosedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementCircuitBreakerClosedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementCircuitBreakerClosedEventData(document.RootElement, options); } default: @@ -131,35 +146,28 @@ ApiManagementCircuitBreakerClosedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementCircuitBreakerClosedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementCircuitBreakerClosedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementCircuitBreakerClosedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementCircuitBreakerClosedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementCircuitBreakerClosedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementCircuitBreakerClosedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementCircuitBreakerClosedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.cs index 7b883eb64505..95e12c2be61a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerClosedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.CircuitBreaker.Closed event. public partial class ApiManagementCircuitBreakerClosedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Name of the backend for which the circuit has closed. /// Information related to the circuit breaker configured on the backend. - /// or is null. internal ApiManagementCircuitBreakerClosedEventData(string backendName, ApiManagementCircuitBreakerProperties circuitBreaker) { - Argument.AssertNotNull(backendName, nameof(backendName)); - Argument.AssertNotNull(circuitBreaker, nameof(circuitBreaker)); - BackendName = backendName; CircuitBreaker = circuitBreaker; } @@ -61,21 +28,17 @@ internal ApiManagementCircuitBreakerClosedEventData(string backendName, ApiManag /// Initializes a new instance of . /// Name of the backend for which the circuit has closed. /// Information related to the circuit breaker configured on the backend. - /// Keeps track of any properties unknown to the library. - internal ApiManagementCircuitBreakerClosedEventData(string backendName, ApiManagementCircuitBreakerProperties circuitBreaker, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementCircuitBreakerClosedEventData(string backendName, ApiManagementCircuitBreakerProperties circuitBreaker, IDictionary additionalBinaryDataProperties) { BackendName = backendName; CircuitBreaker = circuitBreaker; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiManagementCircuitBreakerClosedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Name of the backend for which the circuit has closed. public string BackendName { get; } + /// Information related to the circuit breaker configured on the backend. public ApiManagementCircuitBreakerProperties CircuitBreaker { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.Serialization.cs index 065fca28e648..80632b4db5cb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.CircuitBreaker.Opened event. [JsonConverter(typeof(ApiManagementCircuitBreakerOpenedEventDataConverter))] - public partial class ApiManagementCircuitBreakerOpenedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementCircuitBreakerOpenedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiManagementCircuitBreakerOpenedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,25 +35,24 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementCircuitBreakerOpenedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("backendName"u8); writer.WriteStringValue(BackendName); writer.WritePropertyName("circuitBreaker"u8); writer.WriteObjectValue(CircuitBreaker, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementCircuitBreakerOpenedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementCircuitBreakerOpenedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementCircuitBreakerOpenedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementCircuitBreakerOpenedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementCircuitBreakerOpenedEventData(document.RootElement, options); } - internal static ApiManagementCircuitBreakerOpenedEventData DeserializeApiManagementCircuitBreakerOpenedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementCircuitBreakerOpenedEventData DeserializeApiManagementCircuitBreakerOpenedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string backendName = default; ApiManagementCircuitBreakerProperties circuitBreaker = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("backendName"u8)) + if (prop.NameEquals("backendName"u8)) { - backendName = property.Value.GetString(); + backendName = prop.Value.GetString(); continue; } - if (property.NameEquals("circuitBreaker"u8)) + if (prop.NameEquals("circuitBreaker"u8)) { - circuitBreaker = ApiManagementCircuitBreakerProperties.DeserializeApiManagementCircuitBreakerProperties(property.Value, options); + circuitBreaker = ApiManagementCircuitBreakerProperties.DeserializeApiManagementCircuitBreakerProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementCircuitBreakerOpenedEventData(backendName, circuitBreaker, serializedAdditionalRawData); + return new ApiManagementCircuitBreakerOpenedEventData(backendName, circuitBreaker, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -115,15 +125,20 @@ BinaryData IPersistableModel.Write(M } } - ApiManagementCircuitBreakerOpenedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementCircuitBreakerOpenedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementCircuitBreakerOpenedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementCircuitBreakerOpenedEventData(document.RootElement, options); } default: @@ -131,35 +146,28 @@ ApiManagementCircuitBreakerOpenedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementCircuitBreakerOpenedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementCircuitBreakerOpenedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementCircuitBreakerOpenedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementCircuitBreakerOpenedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementCircuitBreakerOpenedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementCircuitBreakerOpenedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementCircuitBreakerOpenedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.cs index d739428a4a42..859d7355ed41 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerOpenedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.CircuitBreaker.Opened event. public partial class ApiManagementCircuitBreakerOpenedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Name of the backend for which the circuit has opened. /// Information related to the circuit breaker configured on the backend. - /// or is null. internal ApiManagementCircuitBreakerOpenedEventData(string backendName, ApiManagementCircuitBreakerProperties circuitBreaker) { - Argument.AssertNotNull(backendName, nameof(backendName)); - Argument.AssertNotNull(circuitBreaker, nameof(circuitBreaker)); - BackendName = backendName; CircuitBreaker = circuitBreaker; } @@ -61,21 +28,17 @@ internal ApiManagementCircuitBreakerOpenedEventData(string backendName, ApiManag /// Initializes a new instance of . /// Name of the backend for which the circuit has opened. /// Information related to the circuit breaker configured on the backend. - /// Keeps track of any properties unknown to the library. - internal ApiManagementCircuitBreakerOpenedEventData(string backendName, ApiManagementCircuitBreakerProperties circuitBreaker, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementCircuitBreakerOpenedEventData(string backendName, ApiManagementCircuitBreakerProperties circuitBreaker, IDictionary additionalBinaryDataProperties) { BackendName = backendName; CircuitBreaker = circuitBreaker; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiManagementCircuitBreakerOpenedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Name of the backend for which the circuit has opened. public string BackendName { get; } + /// Information related to the circuit breaker configured on the backend. public ApiManagementCircuitBreakerProperties CircuitBreaker { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.Serialization.cs index 269fd480fd66..562f67d8e6a7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ApiManagementCircuitBreakerProperties : IUtf8JsonSerializable, IJsonModel + /// Information related to the circuit breaker configured on the backend. + public partial class ApiManagementCircuitBreakerProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiManagementCircuitBreakerProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementCircuitBreakerProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("rules"u8); writer.WriteStartObject(); foreach (var item in Rules) @@ -47,15 +51,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item.Value, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -64,43 +68,47 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementCircuitBreakerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementCircuitBreakerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementCircuitBreakerProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementCircuitBreakerProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementCircuitBreakerProperties(document.RootElement, options); } - internal static ApiManagementCircuitBreakerProperties DeserializeApiManagementCircuitBreakerProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementCircuitBreakerProperties DeserializeApiManagementCircuitBreakerProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IReadOnlyDictionary rules = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("rules"u8)) + if (prop.NameEquals("rules"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (prop0.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, null); + dictionary.Add(prop0.Name, null); } else { - dictionary.Add(property0.Name, property0.Value.GetObject()); + dictionary.Add(prop0.Name, prop0.Value.GetObject()); } } rules = dictionary; @@ -108,17 +116,19 @@ internal static ApiManagementCircuitBreakerProperties DeserializeApiManagementCi } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementCircuitBreakerProperties(rules, serializedAdditionalRawData); + return new ApiManagementCircuitBreakerProperties(rules, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -128,15 +138,20 @@ BinaryData IPersistableModel.Write(ModelR } } - ApiManagementCircuitBreakerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementCircuitBreakerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementCircuitBreakerProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementCircuitBreakerProperties(document.RootElement, options); } default: @@ -144,22 +159,7 @@ ApiManagementCircuitBreakerProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementCircuitBreakerProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementCircuitBreakerProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.cs index b8c98ca6a627..c293ffc62800 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementCircuitBreakerProperties.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Information related to the circuit breaker configured on the backend. public partial class ApiManagementCircuitBreakerProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Overview of all configured rules and respective details. - /// is null. internal ApiManagementCircuitBreakerProperties(IReadOnlyDictionary rules) { - Argument.AssertNotNull(rules, nameof(rules)); - Rules = rules; } /// Initializes a new instance of . /// Overview of all configured rules and respective details. - /// Keeps track of any properties unknown to the library. - internal ApiManagementCircuitBreakerProperties(IReadOnlyDictionary rules, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementCircuitBreakerProperties(IReadOnlyDictionary rules, IDictionary additionalBinaryDataProperties) { Rules = rules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiManagementCircuitBreakerProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.Serialization.cs index cbd7fb75126d..ffe057306261 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ApiManagementExpiredGatewayTokenProperties : IUtf8JsonSerializable, IJsonModel + /// Information related to a gateway token that has expired for a self-hosted gateway deployment. + public partial class ApiManagementExpiredGatewayTokenProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementExpiredGatewayTokenProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expiredAtUtc"u8); writer.WriteStringValue(ExpiresOn.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +55,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementExpiredGatewayTokenProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementExpiredGatewayTokenProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementExpiredGatewayTokenProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementExpiredGatewayTokenProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementExpiredGatewayTokenProperties(document.RootElement, options); } - internal static ApiManagementExpiredGatewayTokenProperties DeserializeApiManagementExpiredGatewayTokenProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementExpiredGatewayTokenProperties DeserializeApiManagementExpiredGatewayTokenProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? expiredAtUtc = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? expiresOn = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredAtUtc"u8)) + if (prop.NameEquals("expiredAtUtc"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - expiredAtUtc = property.Value.GetDateTimeOffset("O"); + expiresOn = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementExpiredGatewayTokenProperties(expiredAtUtc, serializedAdditionalRawData); + return new ApiManagementExpiredGatewayTokenProperties(expiresOn, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +117,20 @@ BinaryData IPersistableModel.Write(M } } - ApiManagementExpiredGatewayTokenProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementExpiredGatewayTokenProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementExpiredGatewayTokenProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementExpiredGatewayTokenProperties(document.RootElement, options); } default: @@ -128,22 +138,7 @@ ApiManagementExpiredGatewayTokenProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementExpiredGatewayTokenProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementExpiredGatewayTokenProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.cs index 271b17b8a134..d529f206153f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementExpiredGatewayTokenProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Information related to a gateway token that has expired for a self-hosted gateway deployment. public partial class ApiManagementExpiredGatewayTokenProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementExpiredGatewayTokenProperties() @@ -52,11 +23,11 @@ internal ApiManagementExpiredGatewayTokenProperties() /// Initializes a new instance of . /// Timestamp when the gateway token has expired. - /// Keeps track of any properties unknown to the library. - internal ApiManagementExpiredGatewayTokenProperties(DateTimeOffset? expiresOn, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementExpiredGatewayTokenProperties(DateTimeOffset? expiresOn, IDictionary additionalBinaryDataProperties) { ExpiresOn = expiresOn; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Timestamp when the gateway token has expired. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.Serialization.cs index 15a956b3ba68..cf6ccb07fa16 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIAdded event. [JsonConverter(typeof(ApiManagementGatewayApiAddedEventDataConverter))] - public partial class ApiManagementGatewayApiAddedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayApiAddedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayApiAddedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayApiAddedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayApiAddedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayApiAddedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayApiAddedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayApiAddedEventData(document.RootElement, options); } - internal static ApiManagementGatewayApiAddedEventData DeserializeApiManagementGatewayApiAddedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayApiAddedEventData DeserializeApiManagementGatewayApiAddedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayApiAddedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayApiAddedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelR } } - ApiManagementGatewayApiAddedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayApiAddedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayApiAddedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayApiAddedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayApiAddedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayApiAddedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayApiAddedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayApiAddedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayApiAddedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayApiAddedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayApiAddedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayApiAddedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.cs index a044af7e7b8a..4fdb1557c291 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiAddedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIAdded event. public partial class ApiManagementGatewayApiAddedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayApiAddedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayApiAddedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/apis/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayApiAddedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayApiAddedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/apis/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.Serialization.cs index 959e3819c378..2f0f469d2e20 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIRemoved event. [JsonConverter(typeof(ApiManagementGatewayApiRemovedEventDataConverter))] - public partial class ApiManagementGatewayApiRemovedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayApiRemovedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayApiRemovedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayApiRemovedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayApiRemovedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayApiRemovedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayApiRemovedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayApiRemovedEventData(document.RootElement, options); } - internal static ApiManagementGatewayApiRemovedEventData DeserializeApiManagementGatewayApiRemovedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayApiRemovedEventData DeserializeApiManagementGatewayApiRemovedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayApiRemovedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayApiRemovedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mode } } - ApiManagementGatewayApiRemovedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayApiRemovedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayApiRemovedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayApiRemovedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayApiRemovedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayApiRemovedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayApiRemovedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayApiRemovedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayApiRemovedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayApiRemovedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayApiRemovedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayApiRemovedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.cs index 672face4a74c..c801ddac74fc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayApiRemovedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIRemoved event. public partial class ApiManagementGatewayApiRemovedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayApiRemovedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayApiRemovedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/apis/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayApiRemovedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayApiRemovedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/apis/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.Serialization.cs index 6b9ce44e1efa..dc6d5333c123 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityCreated event. [JsonConverter(typeof(ApiManagementGatewayCertificateAuthorityCreatedEventDataConverter))] - public partial class ApiManagementGatewayCertificateAuthorityCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayCertificateAuthorityCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write( /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCertificateAuthorityCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayCertificateAuthorityCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayCertificateAuthorityCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCertificateAuthorityCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCertificateAuthorityCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(document.RootElement, options); } - internal static ApiManagementGatewayCertificateAuthorityCreatedEventData DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayCertificateAuthorityCreatedEventData DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayCertificateAuthorityCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayCertificateAuthorityCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayCertificateAuthorityCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCertificateAuthorityCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayCertificateAuthorityCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayCertificateAuthorityCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayCertificateAuthorityCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayCertificateAuthorityCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayCertificateAuthorityCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayCertificateAuthorityCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.cs index 32b7e53f6027..9ec2b86c4d6b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityCreated event. public partial class ApiManagementGatewayCertificateAuthorityCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayCertificateAuthorityCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayCertificateAuthorityCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayCertificateAuthorityCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayCertificateAuthorityCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.Serialization.cs index b9a05eba9f51..85a528896821 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityDeleted event. [JsonConverter(typeof(ApiManagementGatewayCertificateAuthorityDeletedEventDataConverter))] - public partial class ApiManagementGatewayCertificateAuthorityDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayCertificateAuthorityDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write( /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCertificateAuthorityDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayCertificateAuthorityDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayCertificateAuthorityDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCertificateAuthorityDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCertificateAuthorityDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(document.RootElement, options); } - internal static ApiManagementGatewayCertificateAuthorityDeletedEventData DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayCertificateAuthorityDeletedEventData DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayCertificateAuthorityDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayCertificateAuthorityDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayCertificateAuthorityDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCertificateAuthorityDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayCertificateAuthorityDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayCertificateAuthorityDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayCertificateAuthorityDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayCertificateAuthorityDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayCertificateAuthorityDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayCertificateAuthorityDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.cs index dab4e404a22c..abb2451b2971 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityDeleted event. public partial class ApiManagementGatewayCertificateAuthorityDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayCertificateAuthorityDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayCertificateAuthorityDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayCertificateAuthorityDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayCertificateAuthorityDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.Serialization.cs index 23f2e682e913..2613439f4525 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityUpdated event. [JsonConverter(typeof(ApiManagementGatewayCertificateAuthorityUpdatedEventDataConverter))] - public partial class ApiManagementGatewayCertificateAuthorityUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayCertificateAuthorityUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write( /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCertificateAuthorityUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayCertificateAuthorityUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayCertificateAuthorityUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCertificateAuthorityUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCertificateAuthorityUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(document.RootElement, options); } - internal static ApiManagementGatewayCertificateAuthorityUpdatedEventData DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayCertificateAuthorityUpdatedEventData DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayCertificateAuthorityUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayCertificateAuthorityUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayCertificateAuthorityUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCertificateAuthorityUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayCertificateAuthorityUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayCertificateAuthorityUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayCertificateAuthorityUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayCertificateAuthorityUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayCertificateAuthorityUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayCertificateAuthorityUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.cs index b302731c4cd0..44de2402e3b9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCertificateAuthorityUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityUpdated event. public partial class ApiManagementGatewayCertificateAuthorityUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayCertificateAuthorityUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayCertificateAuthorityUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayCertificateAuthorityUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayCertificateAuthorityUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.Serialization.cs index bb514c20e5ec..e41aa6576264 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCreated event. [JsonConverter(typeof(ApiManagementGatewayCreatedEventDataConverter))] - public partial class ApiManagementGatewayCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayCreatedEventData(document.RootElement, options); } - internal static ApiManagementGatewayCreatedEventData DeserializeApiManagementGatewayCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayCreatedEventData DeserializeApiManagementGatewayCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiManagementGatewayCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.cs index b28dcba9ca70..f1119b64ced7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCreated event. public partial class ApiManagementGatewayCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.Serialization.cs index 4270d5462146..32c3dd02d4a7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayDeleted event. [JsonConverter(typeof(ApiManagementGatewayDeletedEventDataConverter))] - public partial class ApiManagementGatewayDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayDeletedEventData(document.RootElement, options); } - internal static ApiManagementGatewayDeletedEventData DeserializeApiManagementGatewayDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayDeletedEventData DeserializeApiManagementGatewayDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiManagementGatewayDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.cs index 5918a4eec077..c90253bd638f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayDeleted event. public partial class ApiManagementGatewayDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.Serialization.cs index fb29ff1ce834..2dd2c21692af 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationCreated event. [JsonConverter(typeof(ApiManagementGatewayHostnameConfigurationCreatedEventDataConverter))] - public partial class ApiManagementGatewayHostnameConfigurationCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayHostnameConfigurationCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayHostnameConfigurationCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayHostnameConfigurationCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayHostnameConfigurationCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayHostnameConfigurationCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayHostnameConfigurationCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(document.RootElement, options); } - internal static ApiManagementGatewayHostnameConfigurationCreatedEventData DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayHostnameConfigurationCreatedEventData DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayHostnameConfigurationCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayHostnameConfigurationCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayHostnameConfigurationCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayHostnameConfigurationCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayHostnameConfigurationCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayHostnameConfigurationCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayHostnameConfigurationCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayHostnameConfigurationCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayHostnameConfigurationCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayHostnameConfigurationCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.cs index dd89003f1941..fb92b2a9ad62 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationCreated event. public partial class ApiManagementGatewayHostnameConfigurationCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayHostnameConfigurationCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayHostnameConfigurationCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayHostnameConfigurationCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayHostnameConfigurationCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.Serialization.cs index 47f05a47fbfe..b8be25ceb7c5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationDeleted event. [JsonConverter(typeof(ApiManagementGatewayHostnameConfigurationDeletedEventDataConverter))] - public partial class ApiManagementGatewayHostnameConfigurationDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayHostnameConfigurationDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayHostnameConfigurationDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayHostnameConfigurationDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayHostnameConfigurationDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayHostnameConfigurationDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayHostnameConfigurationDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(document.RootElement, options); } - internal static ApiManagementGatewayHostnameConfigurationDeletedEventData DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayHostnameConfigurationDeletedEventData DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayHostnameConfigurationDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayHostnameConfigurationDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayHostnameConfigurationDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayHostnameConfigurationDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayHostnameConfigurationDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayHostnameConfigurationDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayHostnameConfigurationDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayHostnameConfigurationDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayHostnameConfigurationDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayHostnameConfigurationDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.cs index fe117060adce..a3d75130c528 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationDeleted event. public partial class ApiManagementGatewayHostnameConfigurationDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayHostnameConfigurationDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayHostnameConfigurationDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayHostnameConfigurationDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayHostnameConfigurationDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.Serialization.cs index 17eb5df1d089..a534f45c1290 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationUpdated event. [JsonConverter(typeof(ApiManagementGatewayHostnameConfigurationUpdatedEventDataConverter))] - public partial class ApiManagementGatewayHostnameConfigurationUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayHostnameConfigurationUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayHostnameConfigurationUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayHostnameConfigurationUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayHostnameConfigurationUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayHostnameConfigurationUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayHostnameConfigurationUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(document.RootElement, options); } - internal static ApiManagementGatewayHostnameConfigurationUpdatedEventData DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayHostnameConfigurationUpdatedEventData DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayHostnameConfigurationUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayHostnameConfigurationUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayHostnameConfigurationUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayHostnameConfigurationUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayHostnameConfigurationUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayHostnameConfigurationUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayHostnameConfigurationUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayHostnameConfigurationUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayHostnameConfigurationUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayHostnameConfigurationUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.cs index 0dcea1771fde..37cb1b55e796 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayHostnameConfigurationUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationUpdated event. public partial class ApiManagementGatewayHostnameConfigurationUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayHostnameConfigurationUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayHostnameConfigurationUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayHostnameConfigurationUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayHostnameConfigurationUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.Serialization.cs index 3e1b3550a9cb..bd038e239644 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ApiManagementGatewayProperties : IUtf8JsonSerializable, IJsonModel + /// Information related to a given self-hosted gateway deployment. + public partial class ApiManagementGatewayProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiManagementGatewayProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +33,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("gatewayId"u8); writer.WriteStringValue(GatewayId); writer.WritePropertyName("instanceId"u8); writer.WriteStringValue(InstanceId); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +59,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayProperties(document.RootElement, options); } - internal static ApiManagementGatewayProperties DeserializeApiManagementGatewayProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayProperties DeserializeApiManagementGatewayProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string gatewayId = default; string instanceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("gatewayId"u8)) + if (prop.NameEquals("gatewayId"u8)) { - gatewayId = property.Value.GetString(); + gatewayId = prop.Value.GetString(); continue; } - if (property.NameEquals("instanceId"u8)) + if (prop.NameEquals("instanceId"u8)) { - instanceId = property.Value.GetString(); + instanceId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayProperties(gatewayId, instanceId, serializedAdditionalRawData); + return new ApiManagementGatewayProperties(gatewayId, instanceId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +123,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - ApiManagementGatewayProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayProperties(document.RootElement, options); } default: @@ -129,22 +144,7 @@ ApiManagementGatewayProperties IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.cs index 56075c0a60ee..76d21d629c10 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayProperties.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Information related to a given self-hosted gateway deployment. public partial class ApiManagementGatewayProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Id of Gateway that is used to deploy the gateway to get the configuration for. This is the ARM resource ID referenced in the Azure API Management instance. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateway/<GatewayName>`. /// Unique instance ID of the deployed gateway. - /// or is null. internal ApiManagementGatewayProperties(string gatewayId, string instanceId) { - Argument.AssertNotNull(gatewayId, nameof(gatewayId)); - Argument.AssertNotNull(instanceId, nameof(instanceId)); - GatewayId = gatewayId; InstanceId = instanceId; } @@ -61,21 +28,17 @@ internal ApiManagementGatewayProperties(string gatewayId, string instanceId) /// Initializes a new instance of . /// Id of Gateway that is used to deploy the gateway to get the configuration for. This is the ARM resource ID referenced in the Azure API Management instance. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateway/<GatewayName>`. /// Unique instance ID of the deployed gateway. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayProperties(string gatewayId, string instanceId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayProperties(string gatewayId, string instanceId, IDictionary additionalBinaryDataProperties) { GatewayId = gatewayId; InstanceId = instanceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiManagementGatewayProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Id of Gateway that is used to deploy the gateway to get the configuration for. This is the ARM resource ID referenced in the Azure API Management instance. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateway/<GatewayName>`. public string GatewayId { get; } + /// Unique instance ID of the deployed gateway. public string InstanceId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.Serialization.cs index 1424b089d805..fda9ccbd5a5e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayTokenExpired event. [JsonConverter(typeof(ApiManagementGatewayTokenExpiredEventDataConverter))] - public partial class ApiManagementGatewayTokenExpiredEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayTokenExpiredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiManagementGatewayTokenExpiredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,25 +35,24 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayTokenExpiredEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("gatewayInfo"u8); writer.WriteObjectValue(Gateway, options); writer.WritePropertyName("tokenInfo"u8); writer.WriteObjectValue(Token, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayTokenExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayTokenExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayTokenExpiredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayTokenExpiredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayTokenExpiredEventData(document.RootElement, options); } - internal static ApiManagementGatewayTokenExpiredEventData DeserializeApiManagementGatewayTokenExpiredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayTokenExpiredEventData DeserializeApiManagementGatewayTokenExpiredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ApiManagementGatewayProperties gatewayInfo = default; - ApiManagementExpiredGatewayTokenProperties tokenInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + ApiManagementGatewayProperties gateway = default; + ApiManagementExpiredGatewayTokenProperties token = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("gatewayInfo"u8)) + if (prop.NameEquals("gatewayInfo"u8)) { - gatewayInfo = ApiManagementGatewayProperties.DeserializeApiManagementGatewayProperties(property.Value, options); + gateway = ApiManagementGatewayProperties.DeserializeApiManagementGatewayProperties(prop.Value, options); continue; } - if (property.NameEquals("tokenInfo"u8)) + if (prop.NameEquals("tokenInfo"u8)) { - tokenInfo = ApiManagementExpiredGatewayTokenProperties.DeserializeApiManagementExpiredGatewayTokenProperties(property.Value, options); + token = ApiManagementExpiredGatewayTokenProperties.DeserializeApiManagementExpiredGatewayTokenProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayTokenExpiredEventData(gatewayInfo, tokenInfo, serializedAdditionalRawData); + return new ApiManagementGatewayTokenExpiredEventData(gateway, token, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -115,15 +125,20 @@ BinaryData IPersistableModel.Write(Mo } } - ApiManagementGatewayTokenExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayTokenExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayTokenExpiredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayTokenExpiredEventData(document.RootElement, options); } default: @@ -131,35 +146,28 @@ ApiManagementGatewayTokenExpiredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayTokenExpiredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayTokenExpiredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayTokenExpiredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayTokenExpiredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayTokenExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayTokenExpiredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayTokenExpiredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.cs index bcecfc89cd1f..4d366326e4b3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenExpiredEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayTokenExpired event. public partial class ApiManagementGatewayTokenExpiredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Information related to a given self-hosted gateway deployment. /// Information related to a an expired gateway token for a self-hosted gateway deployment. - /// or is null. internal ApiManagementGatewayTokenExpiredEventData(ApiManagementGatewayProperties gateway, ApiManagementExpiredGatewayTokenProperties token) { - Argument.AssertNotNull(gateway, nameof(gateway)); - Argument.AssertNotNull(token, nameof(token)); - Gateway = gateway; Token = token; } @@ -61,21 +28,17 @@ internal ApiManagementGatewayTokenExpiredEventData(ApiManagementGatewayPropertie /// Initializes a new instance of . /// Information related to a given self-hosted gateway deployment. /// Information related to a an expired gateway token for a self-hosted gateway deployment. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayTokenExpiredEventData(ApiManagementGatewayProperties gateway, ApiManagementExpiredGatewayTokenProperties token, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayTokenExpiredEventData(ApiManagementGatewayProperties gateway, ApiManagementExpiredGatewayTokenProperties token, IDictionary additionalBinaryDataProperties) { Gateway = gateway; Token = token; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiManagementGatewayTokenExpiredEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Information related to a given self-hosted gateway deployment. public ApiManagementGatewayProperties Gateway { get; } + /// Information related to a an expired gateway token for a self-hosted gateway deployment. public ApiManagementExpiredGatewayTokenProperties Token { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.Serialization.cs index 5e6dc3ee8055..da19d7da06e2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayTokenNearExpiry event. [JsonConverter(typeof(ApiManagementGatewayTokenNearExpiryEventDataConverter))] - public partial class ApiManagementGatewayTokenNearExpiryEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayTokenNearExpiryEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ApiManagementGatewayTokenNearExpiryEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,25 +35,24 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayTokenNearExpiryEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("gatewayInfo"u8); writer.WriteObjectValue(Gateway, options); writer.WritePropertyName("tokenInfo"u8); writer.WriteObjectValue(Token, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayTokenNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayTokenNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayTokenNearExpiryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayTokenNearExpiryEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayTokenNearExpiryEventData(document.RootElement, options); } - internal static ApiManagementGatewayTokenNearExpiryEventData DeserializeApiManagementGatewayTokenNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayTokenNearExpiryEventData DeserializeApiManagementGatewayTokenNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ApiManagementGatewayProperties gatewayInfo = default; - ApiManagementGatewayTokenNearExpiryProperties tokenInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + ApiManagementGatewayProperties gateway = default; + ApiManagementGatewayTokenNearExpiryProperties token = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("gatewayInfo"u8)) + if (prop.NameEquals("gatewayInfo"u8)) { - gatewayInfo = ApiManagementGatewayProperties.DeserializeApiManagementGatewayProperties(property.Value, options); + gateway = ApiManagementGatewayProperties.DeserializeApiManagementGatewayProperties(prop.Value, options); continue; } - if (property.NameEquals("tokenInfo"u8)) + if (prop.NameEquals("tokenInfo"u8)) { - tokenInfo = ApiManagementGatewayTokenNearExpiryProperties.DeserializeApiManagementGatewayTokenNearExpiryProperties(property.Value, options); + token = ApiManagementGatewayTokenNearExpiryProperties.DeserializeApiManagementGatewayTokenNearExpiryProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayTokenNearExpiryEventData(gatewayInfo, tokenInfo, serializedAdditionalRawData); + return new ApiManagementGatewayTokenNearExpiryEventData(gateway, token, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -115,15 +125,20 @@ BinaryData IPersistableModel.Write } } - ApiManagementGatewayTokenNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayTokenNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayTokenNearExpiryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayTokenNearExpiryEventData(document.RootElement, options); } default: @@ -131,35 +146,28 @@ ApiManagementGatewayTokenNearExpiryEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayTokenNearExpiryEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayTokenNearExpiryEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayTokenNearExpiryEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayTokenNearExpiryEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayTokenNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayTokenNearExpiryEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayTokenNearExpiryEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.cs index 673c3a9e59f8..9533ad6b86c1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayTokenNearExpiry event. public partial class ApiManagementGatewayTokenNearExpiryEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Information related to a given self-hosted gateway deployment. /// Information related to a an expired gateway token for a self-hosted gateway deployment. - /// or is null. internal ApiManagementGatewayTokenNearExpiryEventData(ApiManagementGatewayProperties gateway, ApiManagementGatewayTokenNearExpiryProperties token) { - Argument.AssertNotNull(gateway, nameof(gateway)); - Argument.AssertNotNull(token, nameof(token)); - Gateway = gateway; Token = token; } @@ -61,21 +28,17 @@ internal ApiManagementGatewayTokenNearExpiryEventData(ApiManagementGatewayProper /// Initializes a new instance of . /// Information related to a given self-hosted gateway deployment. /// Information related to a an expired gateway token for a self-hosted gateway deployment. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayTokenNearExpiryEventData(ApiManagementGatewayProperties gateway, ApiManagementGatewayTokenNearExpiryProperties token, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayTokenNearExpiryEventData(ApiManagementGatewayProperties gateway, ApiManagementGatewayTokenNearExpiryProperties token, IDictionary additionalBinaryDataProperties) { Gateway = gateway; Token = token; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ApiManagementGatewayTokenNearExpiryEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Information related to a given self-hosted gateway deployment. public ApiManagementGatewayProperties Gateway { get; } + /// Information related to a an expired gateway token for a self-hosted gateway deployment. public ApiManagementGatewayTokenNearExpiryProperties Token { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.Serialization.cs index aeff07bbd3ad..1d94f4bd831c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ApiManagementGatewayTokenNearExpiryProperties : IUtf8JsonSerializable, IJsonModel + /// Information related to a gateway token that is near expiry for a self-hosted gateway deployment. + public partial class ApiManagementGatewayTokenNearExpiryProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayTokenNearExpiryProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expiredAtUtc"u8); writer.WriteStringValue(ExpiresOn.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +55,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayTokenNearExpiryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayTokenNearExpiryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayTokenNearExpiryProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayTokenNearExpiryProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayTokenNearExpiryProperties(document.RootElement, options); } - internal static ApiManagementGatewayTokenNearExpiryProperties DeserializeApiManagementGatewayTokenNearExpiryProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayTokenNearExpiryProperties DeserializeApiManagementGatewayTokenNearExpiryProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? expiredAtUtc = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? expiresOn = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredAtUtc"u8)) + if (prop.NameEquals("expiredAtUtc"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - expiredAtUtc = property.Value.GetDateTimeOffset("O"); + expiresOn = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayTokenNearExpiryProperties(expiredAtUtc, serializedAdditionalRawData); + return new ApiManagementGatewayTokenNearExpiryProperties(expiresOn, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +117,20 @@ BinaryData IPersistableModel.Writ } } - ApiManagementGatewayTokenNearExpiryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayTokenNearExpiryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayTokenNearExpiryProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayTokenNearExpiryProperties(document.RootElement, options); } default: @@ -128,22 +138,7 @@ ApiManagementGatewayTokenNearExpiryProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayTokenNearExpiryProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayTokenNearExpiryProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.cs index ac0ccb6cd45d..db28a3f4ac8e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayTokenNearExpiryProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Information related to a gateway token that is near expiry for a self-hosted gateway deployment. public partial class ApiManagementGatewayTokenNearExpiryProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayTokenNearExpiryProperties() @@ -52,11 +23,11 @@ internal ApiManagementGatewayTokenNearExpiryProperties() /// Initializes a new instance of . /// Timestamp when the gateway token will expire. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayTokenNearExpiryProperties(DateTimeOffset? expiresOn, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayTokenNearExpiryProperties(DateTimeOffset? expiresOn, IDictionary additionalBinaryDataProperties) { ExpiresOn = expiresOn; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Timestamp when the gateway token will expire. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.Serialization.cs index 6fd5ced7cd9b..6f8214efd254 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayUpdated event. [JsonConverter(typeof(ApiManagementGatewayUpdatedEventDataConverter))] - public partial class ApiManagementGatewayUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementGatewayUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementGatewayUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementGatewayUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementGatewayUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementGatewayUpdatedEventData(document.RootElement, options); } - internal static ApiManagementGatewayUpdatedEventData DeserializeApiManagementGatewayUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementGatewayUpdatedEventData DeserializeApiManagementGatewayUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementGatewayUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementGatewayUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiManagementGatewayUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementGatewayUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementGatewayUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementGatewayUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementGatewayUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementGatewayUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementGatewayUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementGatewayUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementGatewayUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementGatewayUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementGatewayUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementGatewayUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.cs index dc3cc4137431..786f443a7ed0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementGatewayUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayUpdated event. public partial class ApiManagementGatewayUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementGatewayUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementGatewayUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementGatewayUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementGatewayUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.Serialization.cs index 090928e8c53d..cf91826120fc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event. [JsonConverter(typeof(ApiManagementProductCreatedEventDataConverter))] - public partial class ApiManagementProductCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementProductCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementProductCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementProductCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementProductCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementProductCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementProductCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementProductCreatedEventData(document.RootElement, options); } - internal static ApiManagementProductCreatedEventData DeserializeApiManagementProductCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementProductCreatedEventData DeserializeApiManagementProductCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementProductCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementProductCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiManagementProductCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementProductCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementProductCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementProductCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementProductCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementProductCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementProductCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementProductCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementProductCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementProductCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementProductCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementProductCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.cs index d395c9b88db7..5250d8a31f5a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event. public partial class ApiManagementProductCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementProductCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementProductCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementProductCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementProductCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.Serialization.cs index 5d3d0ee403c8..427e6ab47d3c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event. [JsonConverter(typeof(ApiManagementProductDeletedEventDataConverter))] - public partial class ApiManagementProductDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementProductDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementProductDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementProductDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementProductDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementProductDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementProductDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementProductDeletedEventData(document.RootElement, options); } - internal static ApiManagementProductDeletedEventData DeserializeApiManagementProductDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementProductDeletedEventData DeserializeApiManagementProductDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementProductDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementProductDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiManagementProductDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementProductDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementProductDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementProductDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementProductDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementProductDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementProductDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementProductDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementProductDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementProductDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementProductDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementProductDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.cs index 54b5e5c02e30..9d5a697d38de 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event. public partial class ApiManagementProductDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementProductDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementProductDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementProductDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementProductDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.Serialization.cs index ce805d267800..102ffac3311a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event. [JsonConverter(typeof(ApiManagementProductUpdatedEventDataConverter))] - public partial class ApiManagementProductUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementProductUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementProductUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementProductUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementProductUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementProductUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementProductUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementProductUpdatedEventData(document.RootElement, options); } - internal static ApiManagementProductUpdatedEventData DeserializeApiManagementProductUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementProductUpdatedEventData DeserializeApiManagementProductUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementProductUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementProductUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ApiManagementProductUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementProductUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementProductUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementProductUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementProductUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementProductUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementProductUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementProductUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementProductUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementProductUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementProductUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementProductUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.cs index 336ba37353c3..4f9d85f2dd60 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementProductUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event. public partial class ApiManagementProductUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementProductUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementProductUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementProductUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementProductUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.Serialization.cs index d94eb4eabed8..30b5c52f6d0e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event. [JsonConverter(typeof(ApiManagementSubscriptionCreatedEventDataConverter))] - public partial class ApiManagementSubscriptionCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementSubscriptionCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementSubscriptionCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementSubscriptionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementSubscriptionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementSubscriptionCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementSubscriptionCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementSubscriptionCreatedEventData(document.RootElement, options); } - internal static ApiManagementSubscriptionCreatedEventData DeserializeApiManagementSubscriptionCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementSubscriptionCreatedEventData DeserializeApiManagementSubscriptionCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementSubscriptionCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementSubscriptionCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mo } } - ApiManagementSubscriptionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementSubscriptionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementSubscriptionCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementSubscriptionCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementSubscriptionCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementSubscriptionCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementSubscriptionCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementSubscriptionCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementSubscriptionCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementSubscriptionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementSubscriptionCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementSubscriptionCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.cs index e7bc42c2ff74..9a9c2995bf50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event. public partial class ApiManagementSubscriptionCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementSubscriptionCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementSubscriptionCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementSubscriptionCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementSubscriptionCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.Serialization.cs index 58759c90fec1..a99f0f71c47a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event. [JsonConverter(typeof(ApiManagementSubscriptionDeletedEventDataConverter))] - public partial class ApiManagementSubscriptionDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementSubscriptionDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementSubscriptionDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementSubscriptionDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementSubscriptionDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementSubscriptionDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementSubscriptionDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementSubscriptionDeletedEventData(document.RootElement, options); } - internal static ApiManagementSubscriptionDeletedEventData DeserializeApiManagementSubscriptionDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementSubscriptionDeletedEventData DeserializeApiManagementSubscriptionDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementSubscriptionDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementSubscriptionDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mo } } - ApiManagementSubscriptionDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementSubscriptionDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementSubscriptionDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementSubscriptionDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementSubscriptionDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementSubscriptionDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementSubscriptionDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementSubscriptionDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementSubscriptionDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementSubscriptionDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementSubscriptionDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementSubscriptionDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.cs index 3cfae7be4246..979374e74405 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event. public partial class ApiManagementSubscriptionDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementSubscriptionDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementSubscriptionDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementSubscriptionDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementSubscriptionDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.Serialization.cs index 8b7164fe3c5f..fd5bafeadeda 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event. [JsonConverter(typeof(ApiManagementSubscriptionUpdatedEventDataConverter))] - public partial class ApiManagementSubscriptionUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementSubscriptionUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementSubscriptionUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementSubscriptionUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementSubscriptionUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementSubscriptionUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementSubscriptionUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementSubscriptionUpdatedEventData(document.RootElement, options); } - internal static ApiManagementSubscriptionUpdatedEventData DeserializeApiManagementSubscriptionUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementSubscriptionUpdatedEventData DeserializeApiManagementSubscriptionUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementSubscriptionUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementSubscriptionUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(Mo } } - ApiManagementSubscriptionUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementSubscriptionUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementSubscriptionUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementSubscriptionUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementSubscriptionUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementSubscriptionUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementSubscriptionUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementSubscriptionUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementSubscriptionUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementSubscriptionUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementSubscriptionUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementSubscriptionUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.cs index 564941c53a12..8d92004edd49 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementSubscriptionUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event. public partial class ApiManagementSubscriptionUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementSubscriptionUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementSubscriptionUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementSubscriptionUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementSubscriptionUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.Serialization.cs index dea59650e4f9..8a1b971c6f18 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event. [JsonConverter(typeof(ApiManagementUserCreatedEventDataConverter))] - public partial class ApiManagementUserCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementUserCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementUserCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementUserCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementUserCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementUserCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementUserCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementUserCreatedEventData(document.RootElement, options); } - internal static ApiManagementUserCreatedEventData DeserializeApiManagementUserCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementUserCreatedEventData DeserializeApiManagementUserCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementUserCreatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementUserCreatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - ApiManagementUserCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementUserCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementUserCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementUserCreatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementUserCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementUserCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementUserCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementUserCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementUserCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementUserCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementUserCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementUserCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.cs index 5d7803964784..44f82612a22d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event. public partial class ApiManagementUserCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementUserCreatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementUserCreatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementUserCreatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementUserCreatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.Serialization.cs index 995c9fa14dc4..f2fba53cfcef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event. [JsonConverter(typeof(ApiManagementUserDeletedEventDataConverter))] - public partial class ApiManagementUserDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementUserDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementUserDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementUserDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementUserDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementUserDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementUserDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementUserDeletedEventData(document.RootElement, options); } - internal static ApiManagementUserDeletedEventData DeserializeApiManagementUserDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementUserDeletedEventData DeserializeApiManagementUserDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementUserDeletedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementUserDeletedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - ApiManagementUserDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementUserDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementUserDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementUserDeletedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementUserDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementUserDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementUserDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementUserDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementUserDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementUserDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementUserDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementUserDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.cs index 46e4e68a77fa..4c71a4a01a41 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event. public partial class ApiManagementUserDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementUserDeletedEventData() @@ -52,11 +23,11 @@ internal ApiManagementUserDeletedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementUserDeletedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementUserDeletedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.Serialization.cs index b3efe9be1bdd..691e74da9514 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event. [JsonConverter(typeof(ApiManagementUserUpdatedEventDataConverter))] - public partial class ApiManagementUserUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ApiManagementUserUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementUserUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceUri)) { writer.WritePropertyName("resourceUri"u8); writer.WriteStringValue(ResourceUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiManagementUserUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiManagementUserUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiManagementUserUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiManagementUserUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiManagementUserUpdatedEventData(document.RootElement, options); } - internal static ApiManagementUserUpdatedEventData DeserializeApiManagementUserUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiManagementUserUpdatedEventData DeserializeApiManagementUserUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string resourceUri = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiManagementUserUpdatedEventData(resourceUri, serializedAdditionalRawData); + return new ApiManagementUserUpdatedEventData(resourceUri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -110,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - ApiManagementUserUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiManagementUserUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiManagementUserUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiManagementUserUpdatedEventData(document.RootElement, options); } default: @@ -126,35 +136,28 @@ ApiManagementUserUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ApiManagementUserUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeApiManagementUserUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ApiManagementUserUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ApiManagementUserUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ApiManagementUserUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeApiManagementUserUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiManagementUserUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.cs index 07bdfb4686e3..3523ed15a2fe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiManagementUserUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event. public partial class ApiManagementUserUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ApiManagementUserUpdatedEventData() @@ -52,11 +23,11 @@ internal ApiManagementUserUpdatedEventData() /// Initializes a new instance of . /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. - /// Keeps track of any properties unknown to the library. - internal ApiManagementUserUpdatedEventData(string resourceUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiManagementUserUpdatedEventData(string resourceUri, IDictionary additionalBinaryDataProperties) { ResourceUri = resourceUri; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppAction.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppAction.cs index e360f1f1c2eb..bf52283df14b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppAction.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppAction.cs @@ -14,50 +14,77 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AppAction : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AppAction(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// Web app was restarted. private const string RestartedValue = "Restarted"; + /// Web app was stopped. private const string StoppedValue = "Stopped"; + /// There was an operation to change app setting on the web app. private const string ChangedAppSettingsValue = "ChangedAppSettings"; + /// The job has started. private const string StartedValue = "Started"; + /// The job has completed. private const string CompletedValue = "Completed"; + /// The job has failed to complete. private const string FailedValue = "Failed"; + /// Initializes a new instance of . + /// The value. + /// is null. + public AppAction(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// Web app was restarted. public static AppAction Restarted { get; } = new AppAction(RestartedValue); + /// Web app was stopped. public static AppAction Stopped { get; } = new AppAction(StoppedValue); + /// There was an operation to change app setting on the web app. public static AppAction ChangedAppSettings { get; } = new AppAction(ChangedAppSettingsValue); + /// The job has started. public static AppAction Started { get; } = new AppAction(StartedValue); + /// The job has completed. public static AppAction Completed { get; } = new AppAction(CompletedValue); + /// The job has failed to complete. public static AppAction Failed { get; } = new AppAction(FailedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AppAction left, AppAction right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AppAction left, AppAction right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AppAction(string value) => new AppAction(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AppAction?(string value) => value == null ? null : new AppAction(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AppAction other && Equals(other); - /// + + /// public bool Equals(AppAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.Serialization.cs index 76cdc29f52d4..c32a5b7a773a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event. [JsonConverter(typeof(AppConfigurationKeyValueDeletedEventDataConverter))] - public partial class AppConfigurationKeyValueDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AppConfigurationKeyValueDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AppConfigurationKeyValueDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationKeyValueDeletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); writer.WritePropertyName("label"u8); @@ -44,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(Etag); writer.WritePropertyName("syncToken"u8); writer.WriteStringValue(SyncToken); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AppConfigurationKeyValueDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppConfigurationKeyValueDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppConfigurationKeyValueDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationKeyValueDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppConfigurationKeyValueDeletedEventData(document.RootElement, options); } - internal static AppConfigurationKeyValueDeletedEventData DeserializeAppConfigurationKeyValueDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppConfigurationKeyValueDeletedEventData DeserializeAppConfigurationKeyValueDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -85,43 +94,44 @@ internal static AppConfigurationKeyValueDeletedEventData DeserializeAppConfigura string label = default; string etag = default; string syncToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("key"u8)) + if (prop.NameEquals("key"u8)) { - key = property.Value.GetString(); + key = prop.Value.GetString(); continue; } - if (property.NameEquals("label"u8)) + if (prop.NameEquals("label"u8)) { - label = property.Value.GetString(); + label = prop.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("etag"u8)) { - etag = property.Value.GetString(); + etag = prop.Value.GetString(); continue; } - if (property.NameEquals("syncToken"u8)) + if (prop.NameEquals("syncToken"u8)) { - syncToken = property.Value.GetString(); + syncToken = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppConfigurationKeyValueDeletedEventData(key, label, etag, syncToken, serializedAdditionalRawData); + return new AppConfigurationKeyValueDeletedEventData(key, label, etag, syncToken, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -131,15 +141,20 @@ BinaryData IPersistableModel.Write(Mod } } - AppConfigurationKeyValueDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppConfigurationKeyValueDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppConfigurationKeyValueDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppConfigurationKeyValueDeletedEventData(document.RootElement, options); } default: @@ -147,35 +162,28 @@ AppConfigurationKeyValueDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AppConfigurationKeyValueDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppConfigurationKeyValueDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AppConfigurationKeyValueDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AppConfigurationKeyValueDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AppConfigurationKeyValueDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAppConfigurationKeyValueDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationKeyValueDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.cs index 7a4cf1ce7212..0b3366075393 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueDeletedEventData.cs @@ -13,51 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event. public partial class AppConfigurationKeyValueDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The key used to identify the key-value that was deleted. /// The label, if any, used to identify the key-value that was deleted. /// The etag representing the key-value that was deleted. /// The sync token representing the server state after the event. - /// , , or is null. internal AppConfigurationKeyValueDeletedEventData(string key, string label, string etag, string syncToken) { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(label, nameof(label)); - Argument.AssertNotNull(etag, nameof(etag)); - Argument.AssertNotNull(syncToken, nameof(syncToken)); - Key = key; Label = label; Etag = etag; @@ -69,27 +34,25 @@ internal AppConfigurationKeyValueDeletedEventData(string key, string label, stri /// The label, if any, used to identify the key-value that was deleted. /// The etag representing the key-value that was deleted. /// The sync token representing the server state after the event. - /// Keeps track of any properties unknown to the library. - internal AppConfigurationKeyValueDeletedEventData(string key, string label, string etag, string syncToken, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AppConfigurationKeyValueDeletedEventData(string key, string label, string etag, string syncToken, IDictionary additionalBinaryDataProperties) { Key = key; Label = label; Etag = etag; SyncToken = syncToken; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AppConfigurationKeyValueDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The key used to identify the key-value that was deleted. public string Key { get; } + /// The label, if any, used to identify the key-value that was deleted. public string Label { get; } + /// The etag representing the key-value that was deleted. public string Etag { get; } + /// The sync token representing the server state after the event. public string SyncToken { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.Serialization.cs index ceabbd4c60e0..b2c1503ba92f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event. [JsonConverter(typeof(AppConfigurationKeyValueModifiedEventDataConverter))] - public partial class AppConfigurationKeyValueModifiedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AppConfigurationKeyValueModifiedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AppConfigurationKeyValueModifiedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,36 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationKeyValueModifiedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); - if (Label != null) + if (Optional.IsDefined(Label)) { writer.WritePropertyName("label"u8); writer.WriteStringValue(Label); } else { - writer.WriteNull("label"); + writer.WriteNull("label"u8); } writer.WritePropertyName("etag"u8); writer.WriteStringValue(Etag); writer.WritePropertyName("syncToken"u8); writer.WriteStringValue(SyncToken); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +72,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AppConfigurationKeyValueModifiedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppConfigurationKeyValueModifiedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppConfigurationKeyValueModifiedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationKeyValueModifiedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppConfigurationKeyValueModifiedEventData(document.RootElement, options); } - internal static AppConfigurationKeyValueModifiedEventData DeserializeAppConfigurationKeyValueModifiedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppConfigurationKeyValueModifiedEventData DeserializeAppConfigurationKeyValueModifiedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -92,48 +101,49 @@ internal static AppConfigurationKeyValueModifiedEventData DeserializeAppConfigur string label = default; string etag = default; string syncToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("key"u8)) + if (prop.NameEquals("key"u8)) { - key = property.Value.GetString(); + key = prop.Value.GetString(); continue; } - if (property.NameEquals("label"u8)) + if (prop.NameEquals("label"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { label = null; continue; } - label = property.Value.GetString(); + label = prop.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("etag"u8)) { - etag = property.Value.GetString(); + etag = prop.Value.GetString(); continue; } - if (property.NameEquals("syncToken"u8)) + if (prop.NameEquals("syncToken"u8)) { - syncToken = property.Value.GetString(); + syncToken = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppConfigurationKeyValueModifiedEventData(key, label, etag, syncToken, serializedAdditionalRawData); + return new AppConfigurationKeyValueModifiedEventData(key, label, etag, syncToken, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -143,15 +153,20 @@ BinaryData IPersistableModel.Write(Mo } } - AppConfigurationKeyValueModifiedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppConfigurationKeyValueModifiedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppConfigurationKeyValueModifiedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppConfigurationKeyValueModifiedEventData(document.RootElement, options); } default: @@ -159,35 +174,28 @@ AppConfigurationKeyValueModifiedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AppConfigurationKeyValueModifiedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppConfigurationKeyValueModifiedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AppConfigurationKeyValueModifiedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AppConfigurationKeyValueModifiedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AppConfigurationKeyValueModifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAppConfigurationKeyValueModifiedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationKeyValueModifiedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.cs index 1dcc27c11d46..5d4c2d23b930 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationKeyValueModifiedEventData.cs @@ -13,50 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event. public partial class AppConfigurationKeyValueModifiedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The key used to identify the key-value that was modified. /// The label, if any, used to identify the key-value that was modified. /// The etag representing the new state of the key-value. /// The sync token representing the server state after the event. - /// , or is null. internal AppConfigurationKeyValueModifiedEventData(string key, string label, string etag, string syncToken) { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(etag, nameof(etag)); - Argument.AssertNotNull(syncToken, nameof(syncToken)); - Key = key; Label = label; Etag = etag; @@ -68,27 +34,25 @@ internal AppConfigurationKeyValueModifiedEventData(string key, string label, str /// The label, if any, used to identify the key-value that was modified. /// The etag representing the new state of the key-value. /// The sync token representing the server state after the event. - /// Keeps track of any properties unknown to the library. - internal AppConfigurationKeyValueModifiedEventData(string key, string label, string etag, string syncToken, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AppConfigurationKeyValueModifiedEventData(string key, string label, string etag, string syncToken, IDictionary additionalBinaryDataProperties) { Key = key; Label = label; Etag = etag; SyncToken = syncToken; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AppConfigurationKeyValueModifiedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The key used to identify the key-value that was modified. public string Key { get; } + /// The label, if any, used to identify the key-value that was modified. public string Label { get; } + /// The etag representing the new state of the key-value. public string Etag { get; } + /// The sync token representing the server state after the event. public string SyncToken { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.Serialization.cs index b2d5552438ba..d975334fee35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotCreated event. [JsonConverter(typeof(AppConfigurationSnapshotCreatedEventDataConverter))] - public partial class AppConfigurationSnapshotCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AppConfigurationSnapshotCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AppConfigurationSnapshotCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,70 +35,75 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationSnapshotCreatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AppConfigurationSnapshotCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppConfigurationSnapshotCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AppConfigurationSnapshotCreatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AppConfigurationSnapshotEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationSnapshotCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement, options); } - internal static AppConfigurationSnapshotCreatedEventData DeserializeAppConfigurationSnapshotCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppConfigurationSnapshotCreatedEventData DeserializeAppConfigurationSnapshotCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - string etag = default; + string eTag = default; string syncToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("etag"u8)) { - etag = property.Value.GetString(); + eTag = prop.Value.GetString(); continue; } - if (property.NameEquals("syncToken"u8)) + if (prop.NameEquals("syncToken"u8)) { - syncToken = property.Value.GetString(); + syncToken = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppConfigurationSnapshotCreatedEventData(name, etag, syncToken, serializedAdditionalRawData); + return new AppConfigurationSnapshotCreatedEventData(name, eTag, syncToken, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +113,20 @@ BinaryData IPersistableModel.Write(Mod } } - AppConfigurationSnapshotCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppConfigurationSnapshotCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AppConfigurationSnapshotCreatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AppConfigurationSnapshotEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement, options); } default: @@ -119,35 +134,28 @@ AppConfigurationSnapshotCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AppConfigurationSnapshotCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AppConfigurationSnapshotCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AppConfigurationSnapshotCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.cs index e990188ae9cc..bffbf33152c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotCreatedEventData.cs @@ -17,25 +17,16 @@ public partial class AppConfigurationSnapshotCreatedEventData : AppConfiguration /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - /// , or is null. internal AppConfigurationSnapshotCreatedEventData(string name, string eTag, string syncToken) : base(name, eTag, syncToken) { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(eTag, nameof(eTag)); - Argument.AssertNotNull(syncToken, nameof(syncToken)); } /// Initializes a new instance of . /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - /// Keeps track of any properties unknown to the library. - internal AppConfigurationSnapshotCreatedEventData(string name, string eTag, string syncToken, IDictionary serializedAdditionalRawData) : base(name, eTag, syncToken, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AppConfigurationSnapshotCreatedEventData() + /// Keeps track of any properties unknown to the library. + internal AppConfigurationSnapshotCreatedEventData(string name, string eTag, string syncToken, IDictionary additionalBinaryDataProperties) : base(name, eTag, syncToken, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.Serialization.cs index f04e61c5ee28..c92d864c4d16 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of snapshot events. [JsonConverter(typeof(AppConfigurationSnapshotEventDataConverter))] - public partial class AppConfigurationSnapshotEventData : IUtf8JsonSerializable, IJsonModel + public partial class AppConfigurationSnapshotEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AppConfigurationSnapshotEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,27 +35,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationSnapshotEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("etag"u8); writer.WriteStringValue(ETag); writer.WritePropertyName("syncToken"u8); writer.WriteStringValue(SyncToken); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -59,61 +63,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AppConfigurationSnapshotEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppConfigurationSnapshotEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppConfigurationSnapshotEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationSnapshotEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppConfigurationSnapshotEventData(document.RootElement, options); } - internal static AppConfigurationSnapshotEventData DeserializeAppConfigurationSnapshotEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppConfigurationSnapshotEventData DeserializeAppConfigurationSnapshotEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - string etag = default; + string eTag = default; string syncToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("etag"u8)) { - etag = property.Value.GetString(); + eTag = prop.Value.GetString(); continue; } - if (property.NameEquals("syncToken"u8)) + if (prop.NameEquals("syncToken"u8)) { - syncToken = property.Value.GetString(); + syncToken = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppConfigurationSnapshotEventData(name, etag, syncToken, serializedAdditionalRawData); + return new AppConfigurationSnapshotEventData(name, eTag, syncToken, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +133,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - AppConfigurationSnapshotEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppConfigurationSnapshotEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppConfigurationSnapshotEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppConfigurationSnapshotEventData(document.RootElement, options); } default: @@ -139,35 +154,28 @@ AppConfigurationSnapshotEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AppConfigurationSnapshotEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppConfigurationSnapshotEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AppConfigurationSnapshotEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AppConfigurationSnapshotEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAppConfigurationSnapshotEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.cs index 7d7f71b8a54d..31349b5a92db 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotEventData.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of snapshot events. public partial class AppConfigurationSnapshotEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - /// , or is null. internal AppConfigurationSnapshotEventData(string name, string eTag, string syncToken) { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(eTag, nameof(eTag)); - Argument.AssertNotNull(syncToken, nameof(syncToken)); - Name = name; ETag = eTag; SyncToken = syncToken; @@ -65,22 +31,18 @@ internal AppConfigurationSnapshotEventData(string name, string eTag, string sync /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - /// Keeps track of any properties unknown to the library. - internal AppConfigurationSnapshotEventData(string name, string eTag, string syncToken, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AppConfigurationSnapshotEventData(string name, string eTag, string syncToken, IDictionary additionalBinaryDataProperties) { Name = name; ETag = eTag; SyncToken = syncToken; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AppConfigurationSnapshotEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the snapshot. public string Name { get; } + /// The sync token representing the server state after the event. public string SyncToken { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.Serialization.cs index 8b4e8fa27116..e985325f3471 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotModified event. [JsonConverter(typeof(AppConfigurationSnapshotModifiedEventDataConverter))] - public partial class AppConfigurationSnapshotModifiedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AppConfigurationSnapshotModifiedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AppConfigurationSnapshotModifiedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,70 +35,75 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationSnapshotModifiedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AppConfigurationSnapshotModifiedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppConfigurationSnapshotModifiedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AppConfigurationSnapshotModifiedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AppConfigurationSnapshotEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppConfigurationSnapshotModifiedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement, options); } - internal static AppConfigurationSnapshotModifiedEventData DeserializeAppConfigurationSnapshotModifiedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppConfigurationSnapshotModifiedEventData DeserializeAppConfigurationSnapshotModifiedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - string etag = default; + string eTag = default; string syncToken = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("etag"u8)) { - etag = property.Value.GetString(); + eTag = prop.Value.GetString(); continue; } - if (property.NameEquals("syncToken"u8)) + if (prop.NameEquals("syncToken"u8)) { - syncToken = property.Value.GetString(); + syncToken = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppConfigurationSnapshotModifiedEventData(name, etag, syncToken, serializedAdditionalRawData); + return new AppConfigurationSnapshotModifiedEventData(name, eTag, syncToken, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +113,20 @@ BinaryData IPersistableModel.Write(Mo } } - AppConfigurationSnapshotModifiedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppConfigurationSnapshotModifiedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AppConfigurationSnapshotModifiedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AppConfigurationSnapshotEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement, options); } default: @@ -119,35 +134,28 @@ AppConfigurationSnapshotModifiedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AppConfigurationSnapshotModifiedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AppConfigurationSnapshotModifiedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AppConfigurationSnapshotModifiedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AppConfigurationSnapshotModifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationSnapshotModifiedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.cs index cfb845a44627..3b80f53471e3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppConfigurationSnapshotModifiedEventData.cs @@ -17,25 +17,16 @@ public partial class AppConfigurationSnapshotModifiedEventData : AppConfiguratio /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - /// , or is null. internal AppConfigurationSnapshotModifiedEventData(string name, string eTag, string syncToken) : base(name, eTag, syncToken) { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(eTag, nameof(eTag)); - Argument.AssertNotNull(syncToken, nameof(syncToken)); } /// Initializes a new instance of . /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. - /// Keeps track of any properties unknown to the library. - internal AppConfigurationSnapshotModifiedEventData(string name, string eTag, string syncToken, IDictionary serializedAdditionalRawData) : base(name, eTag, syncToken, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AppConfigurationSnapshotModifiedEventData() + /// Keeps track of any properties unknown to the library. + internal AppConfigurationSnapshotModifiedEventData(string name, string eTag, string syncToken, IDictionary additionalBinaryDataProperties) : base(name, eTag, syncToken, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs index 2fc898a25678..ab5ffec4dede 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AppEventTypeDetail : IUtf8JsonSerializable, IJsonModel + /// Detail of action on the app. + public partial class AppEventTypeDetail : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppEventTypeDetail)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); writer.WriteStringValue(Action.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +55,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AppEventTypeDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppEventTypeDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppEventTypeDetail JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppEventTypeDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppEventTypeDetail(document.RootElement, options); } - internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } AppAction? action = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - action = new AppAction(property.Value.GetString()); + action = new AppAction(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppEventTypeDetail(action, serializedAdditionalRawData); + return new AppEventTypeDetail(action, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +117,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - AppEventTypeDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppEventTypeDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppEventTypeDetail PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppEventTypeDetail(document.RootElement, options); } default: @@ -128,22 +138,7 @@ AppEventTypeDetail IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AppEventTypeDetail FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppEventTypeDetail(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs index 236b12ab039c..cc91dc4f1952 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Detail of action on the app. public partial class AppEventTypeDetail { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AppEventTypeDetail() @@ -52,11 +23,11 @@ internal AppEventTypeDetail() /// Initializes a new instance of . /// Type of action of the operation. - /// Keeps track of any properties unknown to the library. - internal AppEventTypeDetail(AppAction? action, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AppEventTypeDetail(AppAction? action, IDictionary additionalBinaryDataProperties) { Action = action; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Type of action of the operation. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanAction.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanAction.cs index 50794cff196b..00c51cec003e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanAction.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanAction.cs @@ -14,35 +14,52 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AppServicePlanAction : IEquatable { private readonly string _value; + /// App Service plan is being updated. + private const string UpdatedValue = "Updated"; /// Initializes a new instance of . + /// The value. /// is null. public AppServicePlanAction(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string UpdatedValue = "Updated"; + _value = value; + } /// App Service plan is being updated. public static AppServicePlanAction Updated { get; } = new AppServicePlanAction(UpdatedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AppServicePlanAction left, AppServicePlanAction right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AppServicePlanAction left, AppServicePlanAction right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AppServicePlanAction(string value) => new AppServicePlanAction(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AppServicePlanAction?(string value) => value == null ? null : new AppServicePlanAction(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AppServicePlanAction other && Equals(other); - /// + + /// public bool Equals(AppServicePlanAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs index 4b4af99d6773..e115f9e45e71 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class AppServicePlanEventTypeDetail : IUtf8JsonSerializable, IJsonModel + /// Detail of action on the app service plan. + public partial class AppServicePlanEventTypeDetail : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppServicePlanEventTypeDetail)} does not support writing '{format}' format."); } - if (Optional.IsDefined(StampKind)) { writer.WritePropertyName("stampKind"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AppServicePlanEventTypeDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AppServicePlanEventTypeDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AppServicePlanEventTypeDetail JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AppServicePlanEventTypeDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAppServicePlanEventTypeDetail(document.RootElement, options); } - internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventTypeDetail(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventTypeDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,50 +93,51 @@ internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventType StampKind? stampKind = default; AppServicePlanAction? action = default; AsyncStatus? status = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("stampKind"u8)) + if (prop.NameEquals("stampKind"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stampKind = new StampKind(property.Value.GetString()); + stampKind = new StampKind(prop.Value.GetString()); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - action = new AppServicePlanAction(property.Value.GetString()); + action = new AppServicePlanAction(prop.Value.GetString()); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new AsyncStatus(property.Value.GetString()); + status = new AsyncStatus(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AppServicePlanEventTypeDetail(stampKind, action, status, serializedAdditionalRawData); + return new AppServicePlanEventTypeDetail(stampKind, action, status, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -142,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AppServicePlanEventTypeDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AppServicePlanEventTypeDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AppServicePlanEventTypeDetail PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAppServicePlanEventTypeDetail(document.RootElement, options); } default: @@ -158,22 +168,7 @@ AppServicePlanEventTypeDetail IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AppServicePlanEventTypeDetail FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAppServicePlanEventTypeDetail(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs index 52cf7ca3592a..e9062127e435 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Detail of action on the app service plan. public partial class AppServicePlanEventTypeDetail { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal AppServicePlanEventTypeDetail() @@ -54,19 +25,21 @@ internal AppServicePlanEventTypeDetail() /// Kind of environment where app service plan is. /// Type of action on the app service plan. /// Asynchronous operation status of the operation on the app service plan. - /// Keeps track of any properties unknown to the library. - internal AppServicePlanEventTypeDetail(StampKind? stampKind, AppServicePlanAction? action, AsyncStatus? status, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AppServicePlanEventTypeDetail(StampKind? stampKind, AppServicePlanAction? action, AsyncStatus? status, IDictionary additionalBinaryDataProperties) { StampKind = stampKind; Action = action; Status = status; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Kind of environment where app service plan is. public StampKind? StampKind { get; } + /// Type of action on the app service plan. public AppServicePlanAction? Action { get; } + /// Asynchronous operation status of the operation on the app service plan. public AsyncStatus? Status { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AsyncStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AsyncStatus.cs index bde75225c10a..a3e884f820c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AsyncStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AsyncStatus.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct AsyncStatus : IEquatable { private readonly string _value; + /// Async operation has started. + private const string StartedValue = "Started"; + /// Async operation has completed. + private const string CompletedValue = "Completed"; + /// Async operation failed to complete. + private const string FailedValue = "Failed"; /// Initializes a new instance of . + /// The value. /// is null. public AsyncStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string StartedValue = "Started"; - private const string CompletedValue = "Completed"; - private const string FailedValue = "Failed"; + _value = value; + } /// Async operation has started. public static AsyncStatus Started { get; } = new AsyncStatus(StartedValue); + /// Async operation has completed. public static AsyncStatus Completed { get; } = new AsyncStatus(CompletedValue); + /// Async operation failed to complete. public static AsyncStatus Failed { get; } = new AsyncStatus(FailedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AsyncStatus left, AsyncStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AsyncStatus left, AsyncStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AsyncStatus(string value) => new AsyncStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AsyncStatus?(string value) => value == null ? null : new AsyncStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AsyncStatus other && Equals(other); - /// + + /// public bool Equals(AsyncStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.Serialization.cs index ceea66bc4b53..4e61ec9c50ac 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterCreated event. [JsonConverter(typeof(AvsClusterCreatedEventDataConverter))] - public partial class AvsClusterCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsClusterCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsClusterCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterCreatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsClusterCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsClusterCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsClusterCreatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsClusterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsClusterCreatedEventData(document.RootElement, options); } - internal static AvsClusterCreatedEventData DeserializeAvsClusterCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsClusterCreatedEventData DeserializeAvsClusterCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,70 +72,92 @@ internal static AvsClusterCreatedEventData DeserializeAvsClusterCreatedEventData IReadOnlyList addedHostNames = default; IReadOnlyList removedHostNames = default; IReadOnlyList inMaintenanceHostNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("addedHostNames"u8)) + if (prop.NameEquals("addedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } addedHostNames = array; continue; } - if (property.NameEquals("removedHostNames"u8)) + if (prop.NameEquals("removedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } removedHostNames = array; continue; } - if (property.NameEquals("inMaintenanceHostNames"u8)) + if (prop.NameEquals("inMaintenanceHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } inMaintenanceHostNames = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsClusterCreatedEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsClusterCreatedEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +167,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - AvsClusterCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsClusterCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsClusterCreatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsClusterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsClusterCreatedEventData(document.RootElement, options); } default: @@ -152,35 +188,28 @@ AvsClusterCreatedEventData IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsClusterCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsClusterCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsClusterCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsClusterCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsClusterCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsClusterCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsClusterCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.cs index 3bfe56d1ac5b..4a1e0551425d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.cs @@ -15,10 +15,8 @@ public partial class AvsClusterCreatedEventData : AvsClusterEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsClusterCreatedEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . @@ -26,13 +24,8 @@ internal AvsClusterCreatedEventData(string operationId) : base(operationId) /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. - /// Keeps track of any properties unknown to the library. - internal AvsClusterCreatedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary serializedAdditionalRawData) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsClusterCreatedEventData() + /// Keeps track of any properties unknown to the library. + internal AvsClusterCreatedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary additionalBinaryDataProperties) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.Serialization.cs index 6a3a6db17b72..1e13b44ed6ef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterDeleted event. [JsonConverter(typeof(AvsClusterDeletedEventDataConverter))] - public partial class AvsClusterDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsClusterDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsClusterDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsClusterDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsClusterDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsClusterDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsClusterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsClusterDeletedEventData(document.RootElement, options); } - internal static AvsClusterDeletedEventData DeserializeAvsClusterDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsClusterDeletedEventData DeserializeAvsClusterDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,70 +72,92 @@ internal static AvsClusterDeletedEventData DeserializeAvsClusterDeletedEventData IReadOnlyList addedHostNames = default; IReadOnlyList removedHostNames = default; IReadOnlyList inMaintenanceHostNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("addedHostNames"u8)) + if (prop.NameEquals("addedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } addedHostNames = array; continue; } - if (property.NameEquals("removedHostNames"u8)) + if (prop.NameEquals("removedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } removedHostNames = array; continue; } - if (property.NameEquals("inMaintenanceHostNames"u8)) + if (prop.NameEquals("inMaintenanceHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } inMaintenanceHostNames = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsClusterDeletedEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsClusterDeletedEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +167,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - AvsClusterDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsClusterDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsClusterDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsClusterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsClusterDeletedEventData(document.RootElement, options); } default: @@ -152,35 +188,28 @@ AvsClusterDeletedEventData IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsClusterDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsClusterDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsClusterDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsClusterDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsClusterDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsClusterDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsClusterDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.cs index 785c205d911b..bd9766a804c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.cs @@ -15,10 +15,8 @@ public partial class AvsClusterDeletedEventData : AvsClusterEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsClusterDeletedEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . @@ -26,13 +24,8 @@ internal AvsClusterDeletedEventData(string operationId) : base(operationId) /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. - /// Keeps track of any properties unknown to the library. - internal AvsClusterDeletedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary serializedAdditionalRawData) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsClusterDeletedEventData() + /// Keeps track of any properties unknown to the library. + internal AvsClusterDeletedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary additionalBinaryDataProperties) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.Serialization.cs index 20cff44213ee..71491c0ac344 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/clusters events. [JsonConverter(typeof(AvsClusterEventDataConverter))] - public partial class AvsClusterEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsClusterEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsClusterEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,20 +35,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationId"u8); writer.WriteStringValue(OperationId); if (options.Format != "W" && Optional.IsCollectionDefined(AddedHostNames)) { writer.WritePropertyName("addedHostNames"u8); writer.WriteStartArray(); - foreach (var item in AddedHostNames) + foreach (string item in AddedHostNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -52,8 +61,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("removedHostNames"u8); writer.WriteStartArray(); - foreach (var item in RemovedHostNames) + foreach (string item in RemovedHostNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -62,21 +76,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("inMaintenanceHostNames"u8); writer.WriteStartArray(); - foreach (var item in InMaintenanceHostNames) + foreach (string item in InMaintenanceHostNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -85,22 +104,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AvsClusterEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsClusterEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AvsClusterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsClusterEventData(document.RootElement, options); } - internal static AvsClusterEventData DeserializeAvsClusterEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsClusterEventData DeserializeAvsClusterEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -109,70 +133,92 @@ internal static AvsClusterEventData DeserializeAvsClusterEventData(JsonElement e IReadOnlyList addedHostNames = default; IReadOnlyList removedHostNames = default; IReadOnlyList inMaintenanceHostNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("addedHostNames"u8)) + if (prop.NameEquals("addedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } addedHostNames = array; continue; } - if (property.NameEquals("removedHostNames"u8)) + if (prop.NameEquals("removedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } removedHostNames = array; continue; } - if (property.NameEquals("inMaintenanceHostNames"u8)) + if (prop.NameEquals("inMaintenanceHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } inMaintenanceHostNames = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsClusterEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsClusterEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -182,15 +228,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - AvsClusterEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsClusterEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AvsClusterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsClusterEventData(document.RootElement, options); } default: @@ -198,35 +249,28 @@ AvsClusterEventData IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AvsClusterEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsClusterEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsClusterEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsClusterEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsClusterEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsClusterEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsClusterEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.cs index 9bcbb7937d13..401e74e10ad6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/clusters events. public partial class AvsClusterEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsClusterEventData(string operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - OperationId = operationId; AddedHostNames = new ChangeTrackingList(); RemovedHostNames = new ChangeTrackingList(); @@ -63,27 +31,25 @@ internal AvsClusterEventData(string operationId) /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. - /// Keeps track of any properties unknown to the library. - internal AvsClusterEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AvsClusterEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary additionalBinaryDataProperties) { OperationId = operationId; AddedHostNames = addedHostNames; RemovedHostNames = removedHostNames; InMaintenanceHostNames = inMaintenanceHostNames; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AvsClusterEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Id of the operation that caused this event. public string OperationId { get; } + /// Hosts added to the cluster in this event, if any. public IReadOnlyList AddedHostNames { get; } + /// Hosts removed from the cluster in this event, if any. public IReadOnlyList RemovedHostNames { get; } + /// Hosts in Maintenance mode in the cluster, if any. public IReadOnlyList InMaintenanceHostNames { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.Serialization.cs index 5a9cb542713e..72c363a6f9a8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterFailed event. [JsonConverter(typeof(AvsClusterFailedEventDataConverter))] - public partial class AvsClusterFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsClusterFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsClusterFailedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterFailedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(FailureMessage)) { @@ -44,106 +48,133 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AvsClusterFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsClusterFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsClusterFailedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsClusterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsClusterFailedEventData(document.RootElement, options); } - internal static AvsClusterFailedEventData DeserializeAvsClusterFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsClusterFailedEventData DeserializeAvsClusterFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string failureMessage = default; string operationId = default; IReadOnlyList addedHostNames = default; IReadOnlyList removedHostNames = default; IReadOnlyList inMaintenanceHostNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string failureMessage = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("failureMessage"u8)) + if (prop.NameEquals("operationId"u8)) { - failureMessage = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("addedHostNames"u8)) { - operationId = property.Value.GetString(); - continue; - } - if (property.NameEquals("addedHostNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } addedHostNames = array; continue; } - if (property.NameEquals("removedHostNames"u8)) + if (prop.NameEquals("removedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } removedHostNames = array; continue; } - if (property.NameEquals("inMaintenanceHostNames"u8)) + if (prop.NameEquals("inMaintenanceHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } inMaintenanceHostNames = array; continue; } + if (prop.NameEquals("failureMessage"u8)) + { + failureMessage = prop.Value.GetString(); + continue; + } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AvsClusterFailedEventData( operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), - serializedAdditionalRawData, + additionalBinaryDataProperties, failureMessage); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -153,15 +184,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - AvsClusterFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsClusterFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsClusterFailedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsClusterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsClusterFailedEventData(document.RootElement, options); } default: @@ -169,35 +205,28 @@ AvsClusterFailedEventData IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsClusterFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsClusterFailedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsClusterFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsClusterFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsClusterFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsClusterFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsClusterFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.cs index d1a51d6c905a..e801a090df62 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.cs @@ -15,10 +15,8 @@ public partial class AvsClusterFailedEventData : AvsClusterEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsClusterFailedEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . @@ -26,18 +24,13 @@ internal AvsClusterFailedEventData(string operationId) : base(operationId) /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Failure reason of an event. - internal AvsClusterFailedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary serializedAdditionalRawData, string failureMessage) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, serializedAdditionalRawData) + internal AvsClusterFailedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary additionalBinaryDataProperties, string failureMessage) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, additionalBinaryDataProperties) { FailureMessage = failureMessage; } - /// Initializes a new instance of for deserialization. - internal AvsClusterFailedEventData() - { - } - /// Failure reason of an event. public string FailureMessage { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.Serialization.cs index 050ff3e7dba4..e4a41718ca3a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterUpdated event. [JsonConverter(typeof(AvsClusterUpdatedEventDataConverter))] - public partial class AvsClusterUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsClusterUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsClusterUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterUpdatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsClusterUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsClusterUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsClusterUpdatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsClusterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsClusterUpdatedEventData(document.RootElement, options); } - internal static AvsClusterUpdatedEventData DeserializeAvsClusterUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsClusterUpdatedEventData DeserializeAvsClusterUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,70 +72,92 @@ internal static AvsClusterUpdatedEventData DeserializeAvsClusterUpdatedEventData IReadOnlyList addedHostNames = default; IReadOnlyList removedHostNames = default; IReadOnlyList inMaintenanceHostNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("addedHostNames"u8)) + if (prop.NameEquals("addedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } addedHostNames = array; continue; } - if (property.NameEquals("removedHostNames"u8)) + if (prop.NameEquals("removedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } removedHostNames = array; continue; } - if (property.NameEquals("inMaintenanceHostNames"u8)) + if (prop.NameEquals("inMaintenanceHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } inMaintenanceHostNames = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsClusterUpdatedEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsClusterUpdatedEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +167,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - AvsClusterUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsClusterUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsClusterUpdatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsClusterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsClusterUpdatedEventData(document.RootElement, options); } default: @@ -152,35 +188,28 @@ AvsClusterUpdatedEventData IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsClusterUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsClusterUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsClusterUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsClusterUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsClusterUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsClusterUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsClusterUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs index 8c2a1e287b48..e8bd225fb2d7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs @@ -15,10 +15,8 @@ public partial class AvsClusterUpdatedEventData : AvsClusterEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsClusterUpdatedEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . @@ -26,13 +24,8 @@ internal AvsClusterUpdatedEventData(string operationId) : base(operationId) /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. - /// Keeps track of any properties unknown to the library. - internal AvsClusterUpdatedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary serializedAdditionalRawData) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsClusterUpdatedEventData() + /// Keeps track of any properties unknown to the library. + internal AvsClusterUpdatedEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary additionalBinaryDataProperties) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.Serialization.cs index 654a3310a892..1a97de4dbc5e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterUpdating event. [JsonConverter(typeof(AvsClusterUpdatingEventDataConverter))] - public partial class AvsClusterUpdatingEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsClusterUpdatingEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsClusterUpdatingEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterUpdatingEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsClusterUpdatingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsClusterUpdatingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsClusterUpdatingEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsClusterEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsClusterUpdatingEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsClusterUpdatingEventData(document.RootElement, options); } - internal static AvsClusterUpdatingEventData DeserializeAvsClusterUpdatingEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsClusterUpdatingEventData DeserializeAvsClusterUpdatingEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,70 +72,92 @@ internal static AvsClusterUpdatingEventData DeserializeAvsClusterUpdatingEventDa IReadOnlyList addedHostNames = default; IReadOnlyList removedHostNames = default; IReadOnlyList inMaintenanceHostNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("addedHostNames"u8)) + if (prop.NameEquals("addedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } addedHostNames = array; continue; } - if (property.NameEquals("removedHostNames"u8)) + if (prop.NameEquals("removedHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } removedHostNames = array; continue; } - if (property.NameEquals("inMaintenanceHostNames"u8)) + if (prop.NameEquals("inMaintenanceHostNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } inMaintenanceHostNames = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsClusterUpdatingEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsClusterUpdatingEventData(operationId, addedHostNames ?? new ChangeTrackingList(), removedHostNames ?? new ChangeTrackingList(), inMaintenanceHostNames ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +167,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AvsClusterUpdatingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsClusterUpdatingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsClusterUpdatingEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsClusterEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsClusterUpdatingEventData(document.RootElement, options); } default: @@ -152,35 +188,28 @@ AvsClusterUpdatingEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsClusterUpdatingEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsClusterUpdatingEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsClusterUpdatingEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsClusterUpdatingEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsClusterUpdatingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsClusterUpdatingEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsClusterUpdatingEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.cs index 94e2a20e48e5..2c0c16eeb09b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.cs @@ -15,10 +15,8 @@ public partial class AvsClusterUpdatingEventData : AvsClusterEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsClusterUpdatingEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . @@ -26,13 +24,8 @@ internal AvsClusterUpdatingEventData(string operationId) : base(operationId) /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. - /// Keeps track of any properties unknown to the library. - internal AvsClusterUpdatingEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary serializedAdditionalRawData) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsClusterUpdatingEventData() + /// Keeps track of any properties unknown to the library. + internal AvsClusterUpdatingEventData(string operationId, IReadOnlyList addedHostNames, IReadOnlyList removedHostNames, IReadOnlyList inMaintenanceHostNames, IDictionary additionalBinaryDataProperties) : base(operationId, addedHostNames, removedHostNames, inMaintenanceHostNames, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.Serialization.cs index b6626b8a36e6..1409727843d8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/privateClouds events. [JsonConverter(typeof(AvsPrivateCloudEventDataConverter))] - public partial class AvsPrivateCloudEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsPrivateCloudEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsPrivateCloudEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,23 +35,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationId"u8); writer.WriteStringValue(OperationId); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,49 +59,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AvsPrivateCloudEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsPrivateCloudEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AvsPrivateCloudEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsPrivateCloudEventData(document.RootElement, options); } - internal static AvsPrivateCloudEventData DeserializeAvsPrivateCloudEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsPrivateCloudEventData DeserializeAvsPrivateCloudEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string operationId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsPrivateCloudEventData(operationId, serializedAdditionalRawData); + return new AvsPrivateCloudEventData(operationId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +117,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - AvsPrivateCloudEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsPrivateCloudEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AvsPrivateCloudEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsPrivateCloudEventData(document.RootElement, options); } default: @@ -123,35 +138,28 @@ AvsPrivateCloudEventData IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AvsPrivateCloudEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsPrivateCloudEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsPrivateCloudEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsPrivateCloudEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsPrivateCloudEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsPrivateCloudEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsPrivateCloudEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.cs index 34b79d5aa63c..7006aeefbca6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/privateClouds events. public partial class AvsPrivateCloudEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsPrivateCloudEventData(string operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - OperationId = operationId; } /// Initializes a new instance of . /// Id of the operation that caused this event. - /// Keeps track of any properties unknown to the library. - internal AvsPrivateCloudEventData(string operationId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AvsPrivateCloudEventData(string operationId, IDictionary additionalBinaryDataProperties) { OperationId = operationId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AvsPrivateCloudEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Id of the operation that caused this event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.Serialization.cs index dfb242884941..31eef42efc30 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.PrivateCloudFailed event. [JsonConverter(typeof(AvsPrivateCloudFailedEventDataConverter))] - public partial class AvsPrivateCloudFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsPrivateCloudFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsPrivateCloudFailedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudFailedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(FailureMessage)) { @@ -44,55 +48,61 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AvsPrivateCloudFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsPrivateCloudFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsPrivateCloudFailedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsPrivateCloudEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsPrivateCloudFailedEventData(document.RootElement, options); } - internal static AvsPrivateCloudFailedEventData DeserializeAvsPrivateCloudFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsPrivateCloudFailedEventData DeserializeAvsPrivateCloudFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string failureMessage = default; string operationId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string failureMessage = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("failureMessage"u8)) + if (prop.NameEquals("operationId"u8)) { - failureMessage = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("failureMessage"u8)) { - operationId = property.Value.GetString(); + failureMessage = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsPrivateCloudFailedEventData(operationId, serializedAdditionalRawData, failureMessage); + return new AvsPrivateCloudFailedEventData(operationId, additionalBinaryDataProperties, failureMessage); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -102,15 +112,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - AvsPrivateCloudFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsPrivateCloudFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsPrivateCloudFailedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsPrivateCloudEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsPrivateCloudFailedEventData(document.RootElement, options); } default: @@ -118,35 +133,28 @@ AvsPrivateCloudFailedEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsPrivateCloudFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsPrivateCloudFailedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsPrivateCloudFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsPrivateCloudFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsPrivateCloudFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsPrivateCloudFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsPrivateCloudFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.cs index 462c74752b07..fbde8ec9688d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.cs @@ -15,26 +15,19 @@ public partial class AvsPrivateCloudFailedEventData : AvsPrivateCloudEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsPrivateCloudFailedEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . /// Id of the operation that caused this event. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Failure reason of an event. - internal AvsPrivateCloudFailedEventData(string operationId, IDictionary serializedAdditionalRawData, string failureMessage) : base(operationId, serializedAdditionalRawData) + internal AvsPrivateCloudFailedEventData(string operationId, IDictionary additionalBinaryDataProperties, string failureMessage) : base(operationId, additionalBinaryDataProperties) { FailureMessage = failureMessage; } - /// Initializes a new instance of for deserialization. - internal AvsPrivateCloudFailedEventData() - { - } - /// Failure reason of an event. public string FailureMessage { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.Serialization.cs index 2ace3fccf005..018617b70987 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.PrivateCloudUpdated event. [JsonConverter(typeof(AvsPrivateCloudUpdatedEventDataConverter))] - public partial class AvsPrivateCloudUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsPrivateCloudUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsPrivateCloudUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudUpdatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsPrivateCloudUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsPrivateCloudUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsPrivateCloudUpdatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsPrivateCloudEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsPrivateCloudUpdatedEventData(document.RootElement, options); } - internal static AvsPrivateCloudUpdatedEventData DeserializeAvsPrivateCloudUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsPrivateCloudUpdatedEventData DeserializeAvsPrivateCloudUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string operationId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsPrivateCloudUpdatedEventData(operationId, serializedAdditionalRawData); + return new AvsPrivateCloudUpdatedEventData(operationId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - AvsPrivateCloudUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsPrivateCloudUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsPrivateCloudUpdatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsPrivateCloudEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsPrivateCloudUpdatedEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ AvsPrivateCloudUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsPrivateCloudUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsPrivateCloudUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsPrivateCloudUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsPrivateCloudUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsPrivateCloudUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsPrivateCloudUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsPrivateCloudUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs index 08700112d7a0..07700f9c3b73 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs @@ -15,21 +15,14 @@ public partial class AvsPrivateCloudUpdatedEventData : AvsPrivateCloudEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsPrivateCloudUpdatedEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . /// Id of the operation that caused this event. - /// Keeps track of any properties unknown to the library. - internal AvsPrivateCloudUpdatedEventData(string operationId, IDictionary serializedAdditionalRawData) : base(operationId, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsPrivateCloudUpdatedEventData() + /// Keeps track of any properties unknown to the library. + internal AvsPrivateCloudUpdatedEventData(string operationId, IDictionary additionalBinaryDataProperties) : base(operationId, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.Serialization.cs index 759e621ee5fb..a3299992122f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.PrivateCloudUpdating event. [JsonConverter(typeof(AvsPrivateCloudUpdatingEventDataConverter))] - public partial class AvsPrivateCloudUpdatingEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsPrivateCloudUpdatingEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsPrivateCloudUpdatingEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudUpdatingEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsPrivateCloudUpdatingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsPrivateCloudUpdatingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsPrivateCloudUpdatingEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsPrivateCloudEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsPrivateCloudUpdatingEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsPrivateCloudUpdatingEventData(document.RootElement, options); } - internal static AvsPrivateCloudUpdatingEventData DeserializeAvsPrivateCloudUpdatingEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsPrivateCloudUpdatingEventData DeserializeAvsPrivateCloudUpdatingEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string operationId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsPrivateCloudUpdatingEventData(operationId, serializedAdditionalRawData); + return new AvsPrivateCloudUpdatingEventData(operationId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - AvsPrivateCloudUpdatingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsPrivateCloudUpdatingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsPrivateCloudUpdatingEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsPrivateCloudEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsPrivateCloudUpdatingEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ AvsPrivateCloudUpdatingEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsPrivateCloudUpdatingEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsPrivateCloudUpdatingEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsPrivateCloudUpdatingEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsPrivateCloudUpdatingEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsPrivateCloudUpdatingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsPrivateCloudUpdatingEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsPrivateCloudUpdatingEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.cs index 160c3343a6cf..d69b1ed47010 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.cs @@ -15,21 +15,14 @@ public partial class AvsPrivateCloudUpdatingEventData : AvsPrivateCloudEventData { /// Initializes a new instance of . /// Id of the operation that caused this event. - /// is null. internal AvsPrivateCloudUpdatingEventData(string operationId) : base(operationId) { - Argument.AssertNotNull(operationId, nameof(operationId)); } /// Initializes a new instance of . /// Id of the operation that caused this event. - /// Keeps track of any properties unknown to the library. - internal AvsPrivateCloudUpdatingEventData(string operationId, IDictionary serializedAdditionalRawData) : base(operationId, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsPrivateCloudUpdatingEventData() + /// Keeps track of any properties unknown to the library. + internal AvsPrivateCloudUpdatingEventData(string operationId, IDictionary additionalBinaryDataProperties) : base(operationId, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.Serialization.cs index a3183df101ed..c769e9f2d6c3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionCancelled event. [JsonConverter(typeof(AvsScriptExecutionCancelledEventDataConverter))] - public partial class AvsScriptExecutionCancelledEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsScriptExecutionCancelledEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionCancelledEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionCancelledEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsScriptExecutionCancelledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsScriptExecutionCancelledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsScriptExecutionCancelledEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionCancelledEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsScriptExecutionCancelledEventData(document.RootElement, options); } - internal static AvsScriptExecutionCancelledEventData DeserializeAvsScriptExecutionCancelledEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsScriptExecutionCancelledEventData DeserializeAvsScriptExecutionCancelledEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -62,47 +71,55 @@ internal static AvsScriptExecutionCancelledEventData DeserializeAvsScriptExecuti string operationId = default; string cmdletId = default; IReadOnlyList output = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("cmdletId"u8)) + if (prop.NameEquals("cmdletId"u8)) { - cmdletId = property.Value.GetString(); + cmdletId = prop.Value.GetString(); continue; } - if (property.NameEquals("output"u8)) + if (prop.NameEquals("output"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } output = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsScriptExecutionCancelledEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsScriptExecutionCancelledEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +129,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - AvsScriptExecutionCancelledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsScriptExecutionCancelledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsScriptExecutionCancelledEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsScriptExecutionCancelledEventData(document.RootElement, options); } default: @@ -128,35 +150,28 @@ AvsScriptExecutionCancelledEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsScriptExecutionCancelledEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsScriptExecutionCancelledEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsScriptExecutionCancelledEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsScriptExecutionCancelledEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsScriptExecutionCancelledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsScriptExecutionCancelledEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsScriptExecutionCancelledEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.cs index c19de0780976..1d7ca6dfa92f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.cs @@ -16,24 +16,16 @@ public partial class AvsScriptExecutionCancelledEventData : AvsScriptExecutionEv /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. - /// or is null. internal AvsScriptExecutionCancelledEventData(string operationId, string cmdletId) : base(operationId, cmdletId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - Argument.AssertNotNull(cmdletId, nameof(cmdletId)); } /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. - /// Keeps track of any properties unknown to the library. - internal AvsScriptExecutionCancelledEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData) : base(operationId, cmdletId, output, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsScriptExecutionCancelledEventData() + /// Keeps track of any properties unknown to the library. + internal AvsScriptExecutionCancelledEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties) : base(operationId, cmdletId, output, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.Serialization.cs index e3b191a37728..e37083322786 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/scriptExecutions events. [JsonConverter(typeof(AvsScriptExecutionEventDataConverter))] - public partial class AvsScriptExecutionEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsScriptExecutionEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("operationId"u8); writer.WriteStringValue(OperationId); writer.WritePropertyName("cmdletId"u8); @@ -44,21 +48,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("output"u8); writer.WriteStartArray(); - foreach (var item in Output) + foreach (string item in Output) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,22 +76,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AvsScriptExecutionEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsScriptExecutionEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AvsScriptExecutionEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsScriptExecutionEventData(document.RootElement, options); } - internal static AvsScriptExecutionEventData DeserializeAvsScriptExecutionEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsScriptExecutionEventData DeserializeAvsScriptExecutionEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -90,47 +104,55 @@ internal static AvsScriptExecutionEventData DeserializeAvsScriptExecutionEventDa string operationId = default; string cmdletId = default; IReadOnlyList output = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("cmdletId"u8)) + if (prop.NameEquals("cmdletId"u8)) { - cmdletId = property.Value.GetString(); + cmdletId = prop.Value.GetString(); continue; } - if (property.NameEquals("output"u8)) + if (prop.NameEquals("output"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } output = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsScriptExecutionEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsScriptExecutionEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -140,15 +162,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - AvsScriptExecutionEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsScriptExecutionEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AvsScriptExecutionEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsScriptExecutionEventData(document.RootElement, options); } default: @@ -156,35 +183,28 @@ AvsScriptExecutionEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AvsScriptExecutionEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsScriptExecutionEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsScriptExecutionEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsScriptExecutionEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsScriptExecutionEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsScriptExecutionEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsScriptExecutionEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.cs index 90ddfcbfd12d..924b9d262dfc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/scriptExecutions events. public partial class AvsScriptExecutionEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. - /// or is null. internal AvsScriptExecutionEventData(string operationId, string cmdletId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - Argument.AssertNotNull(cmdletId, nameof(cmdletId)); - OperationId = operationId; CmdletId = cmdletId; Output = new ChangeTrackingList(); @@ -63,24 +30,21 @@ internal AvsScriptExecutionEventData(string operationId, string cmdletId) /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. - /// Keeps track of any properties unknown to the library. - internal AvsScriptExecutionEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AvsScriptExecutionEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties) { OperationId = operationId; CmdletId = cmdletId; Output = output; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AvsScriptExecutionEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Id of the operation that caused this event. public string OperationId { get; } + /// Cmdlet referenced in the execution that caused this event. public string CmdletId { get; } + /// Stdout outputs from the execution, if any. public IReadOnlyList Output { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.Serialization.cs index 5a29d2f38cb2..32dd671c38d8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionFailed event. [JsonConverter(typeof(AvsScriptExecutionFailedEventDataConverter))] - public partial class AvsScriptExecutionFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsScriptExecutionFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionFailedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionFailedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(FailureMessage)) { @@ -44,76 +48,89 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - AvsScriptExecutionFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsScriptExecutionFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsScriptExecutionFailedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsScriptExecutionFailedEventData(document.RootElement, options); } - internal static AvsScriptExecutionFailedEventData DeserializeAvsScriptExecutionFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsScriptExecutionFailedEventData DeserializeAvsScriptExecutionFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string failureMessage = default; string operationId = default; string cmdletId = default; IReadOnlyList output = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string failureMessage = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("failureMessage"u8)) + if (prop.NameEquals("operationId"u8)) { - failureMessage = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("cmdletId"u8)) { - operationId = property.Value.GetString(); + cmdletId = prop.Value.GetString(); continue; } - if (property.NameEquals("cmdletId"u8)) + if (prop.NameEquals("output"u8)) { - cmdletId = property.Value.GetString(); - continue; - } - if (property.NameEquals("output"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } output = array; continue; } + if (prop.NameEquals("failureMessage"u8)) + { + failureMessage = prop.Value.GetString(); + continue; + } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsScriptExecutionFailedEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), serializedAdditionalRawData, failureMessage); + return new AvsScriptExecutionFailedEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), additionalBinaryDataProperties, failureMessage); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +140,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - AvsScriptExecutionFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsScriptExecutionFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsScriptExecutionFailedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsScriptExecutionFailedEventData(document.RootElement, options); } default: @@ -139,35 +161,28 @@ AvsScriptExecutionFailedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsScriptExecutionFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsScriptExecutionFailedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsScriptExecutionFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsScriptExecutionFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsScriptExecutionFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsScriptExecutionFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsScriptExecutionFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.cs index c508a421bf97..5e1723b0f531 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.cs @@ -16,29 +16,21 @@ public partial class AvsScriptExecutionFailedEventData : AvsScriptExecutionEvent /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. - /// or is null. internal AvsScriptExecutionFailedEventData(string operationId, string cmdletId) : base(operationId, cmdletId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - Argument.AssertNotNull(cmdletId, nameof(cmdletId)); } /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Failure reason of an event. - internal AvsScriptExecutionFailedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData, string failureMessage) : base(operationId, cmdletId, output, serializedAdditionalRawData) + internal AvsScriptExecutionFailedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties, string failureMessage) : base(operationId, cmdletId, output, additionalBinaryDataProperties) { FailureMessage = failureMessage; } - /// Initializes a new instance of for deserialization. - internal AvsScriptExecutionFailedEventData() - { - } - /// Failure reason of an event. public string FailureMessage { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs index e0fd4f851708..217531950bf6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionFinished event. [JsonConverter(typeof(AvsScriptExecutionFinishedEventDataConverter))] - public partial class AvsScriptExecutionFinishedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsScriptExecutionFinishedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionFinishedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,98 +35,122 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionFinishedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("namedOutputs"u8); writer.WriteStartObject(); foreach (var item in NamedOutputs) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - AvsScriptExecutionFinishedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsScriptExecutionFinishedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsScriptExecutionFinishedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionFinishedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsScriptExecutionFinishedEventData(document.RootElement, options); } - internal static AvsScriptExecutionFinishedEventData DeserializeAvsScriptExecutionFinishedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsScriptExecutionFinishedEventData DeserializeAvsScriptExecutionFinishedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyDictionary namedOutputs = default; string operationId = default; string cmdletId = default; IReadOnlyList output = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary namedOutputs = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("namedOutputs"u8)) + if (prop.NameEquals("operationId"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - namedOutputs = dictionary; + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("cmdletId"u8)) { - operationId = property.Value.GetString(); + cmdletId = prop.Value.GetString(); continue; } - if (property.NameEquals("cmdletId"u8)) + if (prop.NameEquals("output"u8)) { - cmdletId = property.Value.GetString(); - continue; - } - if (property.NameEquals("output"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } output = array; continue; } + if (prop.NameEquals("namedOutputs"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var prop0 in prop.Value.EnumerateObject()) + { + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } + } + namedOutputs = dictionary; + continue; + } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsScriptExecutionFinishedEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), serializedAdditionalRawData, namedOutputs); + return new AvsScriptExecutionFinishedEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), additionalBinaryDataProperties, namedOutputs); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -131,15 +160,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - AvsScriptExecutionFinishedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsScriptExecutionFinishedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsScriptExecutionFinishedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsScriptExecutionFinishedEventData(document.RootElement, options); } default: @@ -147,35 +181,28 @@ AvsScriptExecutionFinishedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsScriptExecutionFinishedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsScriptExecutionFinishedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsScriptExecutionFinishedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsScriptExecutionFinishedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsScriptExecutionFinishedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsScriptExecutionFinishedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsScriptExecutionFinishedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs index caca8718ae2e..ad5bf05aea48 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs @@ -17,13 +17,8 @@ public partial class AvsScriptExecutionFinishedEventData : AvsScriptExecutionEve /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Named outputs of completed execution, if any. - /// , or is null. - internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IReadOnlyDictionary namedOutputs) : base(operationId, cmdletId) + internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IDictionary namedOutputs) : base(operationId, cmdletId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - Argument.AssertNotNull(cmdletId, nameof(cmdletId)); - Argument.AssertNotNull(namedOutputs, nameof(namedOutputs)); - NamedOutputs = namedOutputs; } @@ -31,19 +26,14 @@ internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Named outputs of completed execution, if any. - internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData, IReadOnlyDictionary namedOutputs) : base(operationId, cmdletId, output, serializedAdditionalRawData) + internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties, IDictionary namedOutputs) : base(operationId, cmdletId, output, additionalBinaryDataProperties) { NamedOutputs = namedOutputs; } - /// Initializes a new instance of for deserialization. - internal AvsScriptExecutionFinishedEventData() - { - } - /// Named outputs of completed execution, if any. - public IReadOnlyDictionary NamedOutputs { get; } + public IDictionary NamedOutputs { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.Serialization.cs index 24068a5b7074..0b9465d4b4a4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionStarted event. [JsonConverter(typeof(AvsScriptExecutionStartedEventDataConverter))] - public partial class AvsScriptExecutionStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class AvsScriptExecutionStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionStartedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionStartedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - AvsScriptExecutionStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AvsScriptExecutionStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AvsScriptExecutionStartedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AvsScriptExecutionStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAvsScriptExecutionStartedEventData(document.RootElement, options); } - internal static AvsScriptExecutionStartedEventData DeserializeAvsScriptExecutionStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AvsScriptExecutionStartedEventData DeserializeAvsScriptExecutionStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -62,47 +71,55 @@ internal static AvsScriptExecutionStartedEventData DeserializeAvsScriptExecution string operationId = default; string cmdletId = default; IReadOnlyList output = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("operationId"u8)) + if (prop.NameEquals("operationId"u8)) { - operationId = property.Value.GetString(); + operationId = prop.Value.GetString(); continue; } - if (property.NameEquals("cmdletId"u8)) + if (prop.NameEquals("cmdletId"u8)) { - cmdletId = property.Value.GetString(); + cmdletId = prop.Value.GetString(); continue; } - if (property.NameEquals("output"u8)) + if (prop.NameEquals("output"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } output = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AvsScriptExecutionStartedEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AvsScriptExecutionStartedEventData(operationId, cmdletId, output ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +129,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - AvsScriptExecutionStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AvsScriptExecutionStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AvsScriptExecutionStartedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override AvsScriptExecutionEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAvsScriptExecutionStartedEventData(document.RootElement, options); } default: @@ -128,35 +150,28 @@ AvsScriptExecutionStartedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new AvsScriptExecutionStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAvsScriptExecutionStartedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class AvsScriptExecutionStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, AvsScriptExecutionStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override AvsScriptExecutionStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeAvsScriptExecutionStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsScriptExecutionStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.cs index 2f07a5a6a36a..59db308442e8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.cs @@ -16,24 +16,16 @@ public partial class AvsScriptExecutionStartedEventData : AvsScriptExecutionEven /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. - /// or is null. internal AvsScriptExecutionStartedEventData(string operationId, string cmdletId) : base(operationId, cmdletId) { - Argument.AssertNotNull(operationId, nameof(operationId)); - Argument.AssertNotNull(cmdletId, nameof(cmdletId)); } /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. - /// Keeps track of any properties unknown to the library. - internal AvsScriptExecutionStartedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData) : base(operationId, cmdletId, output, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal AvsScriptExecutionStartedEventData() + /// Keeps track of any properties unknown to the library. + internal AvsScriptExecutionStartedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties) : base(operationId, cmdletId, output, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationCloudEnvironmentModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationCloudEnvironmentModel.cs index 5bbdda0f5e33..285c15392634 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationCloudEnvironmentModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationCloudEnvironmentModel.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct CommunicationCloudEnvironmentModel : IEquatable { private readonly string _value; + /// Public. + private const string PublicValue = "public"; + /// Dod. + private const string DodValue = "dod"; + /// Gcch. + private const string GcchValue = "gcch"; /// Initializes a new instance of . + /// The value. /// is null. public CommunicationCloudEnvironmentModel(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string PublicValue = "public"; - private const string DodValue = "dod"; - private const string GcchValue = "gcch"; + _value = value; + } /// Public. public static CommunicationCloudEnvironmentModel Public { get; } = new CommunicationCloudEnvironmentModel(PublicValue); + /// Dod. public static CommunicationCloudEnvironmentModel Dod { get; } = new CommunicationCloudEnvironmentModel(DodValue); + /// Gcch. public static CommunicationCloudEnvironmentModel Gcch { get; } = new CommunicationCloudEnvironmentModel(GcchValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(CommunicationCloudEnvironmentModel left, CommunicationCloudEnvironmentModel right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(CommunicationCloudEnvironmentModel left, CommunicationCloudEnvironmentModel right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator CommunicationCloudEnvironmentModel(string value) => new CommunicationCloudEnvironmentModel(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator CommunicationCloudEnvironmentModel?(string value) => value == null ? null : new CommunicationCloudEnvironmentModel(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CommunicationCloudEnvironmentModel other && Equals(other); - /// + + /// public bool Equals(CommunicationCloudEnvironmentModel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs index 61d60fb9a6e4..2ab7c7b34948 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class CommunicationIdentifierModel : IUtf8JsonSerializable, IJsonModel + /// Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. + public partial class CommunicationIdentifierModel : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CommunicationIdentifierModel() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CommunicationIdentifierModel)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -58,15 +62,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("microsoftTeamsApp"u8); writer.WriteObjectValue(MicrosoftTeamsApp, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,22 +79,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CommunicationIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CommunicationIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CommunicationIdentifierModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CommunicationIdentifierModel)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCommunicationIdentifierModel(document.RootElement, options); } - internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierModel(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierModel(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -101,62 +110,60 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM PhoneNumberIdentifierModel phoneNumber = default; MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = default; AcsMicrosoftTeamsAppIdentifier microsoftTeamsApp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("kind"u8)) + if (prop.NameEquals("kind"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - kind = new AcsCommunicationIdentifierKind(property.Value.GetString()); + kind = new AcsCommunicationIdentifierKind(prop.Value.GetString()); continue; } - if (property.NameEquals("rawId"u8)) + if (prop.NameEquals("rawId"u8)) { - rawId = property.Value.GetString(); + rawId = prop.Value.GetString(); continue; } - if (property.NameEquals("communicationUser"u8)) + if (prop.NameEquals("communicationUser"u8)) { - communicationUser = CommunicationUserIdentifierModel.DeserializeCommunicationUserIdentifierModel(property.Value, options); + communicationUser = CommunicationUserIdentifierModel.DeserializeCommunicationUserIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("phoneNumber"u8)) + if (prop.NameEquals("phoneNumber"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - phoneNumber = PhoneNumberIdentifierModel.DeserializePhoneNumberIdentifierModel(property.Value, options); + phoneNumber = PhoneNumberIdentifierModel.DeserializePhoneNumberIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("microsoftTeamsUser"u8)) + if (prop.NameEquals("microsoftTeamsUser"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - microsoftTeamsUser = MicrosoftTeamsUserIdentifierModel.DeserializeMicrosoftTeamsUserIdentifierModel(property.Value, options); + microsoftTeamsUser = MicrosoftTeamsUserIdentifierModel.DeserializeMicrosoftTeamsUserIdentifierModel(prop.Value, options); continue; } - if (property.NameEquals("microsoftTeamsApp"u8)) + if (prop.NameEquals("microsoftTeamsApp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - microsoftTeamsApp = AcsMicrosoftTeamsAppIdentifier.DeserializeAcsMicrosoftTeamsAppIdentifier(property.Value, options); + microsoftTeamsApp = AcsMicrosoftTeamsAppIdentifier.DeserializeAcsMicrosoftTeamsAppIdentifier(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new CommunicationIdentifierModel( kind, rawId, @@ -164,13 +171,16 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM phoneNumber, microsoftTeamsUser, microsoftTeamsApp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -180,15 +190,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - CommunicationIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CommunicationIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CommunicationIdentifierModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCommunicationIdentifierModel(document.RootElement, options); } default: @@ -196,22 +211,7 @@ CommunicationIdentifierModel IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static CommunicationIdentifierModel FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCommunicationIdentifierModel(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs index 7c0a64f6bf36..7509d1360362 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. public partial class CommunicationIdentifierModel { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Raw Id of the identifier. Optional in requests, required in responses. /// The communication user. - /// or is null. internal CommunicationIdentifierModel(string rawId, CommunicationUserIdentifierModel communicationUser) { - Argument.AssertNotNull(rawId, nameof(rawId)); - Argument.AssertNotNull(communicationUser, nameof(communicationUser)); - RawId = rawId; CommunicationUser = communicationUser; } @@ -65,8 +32,8 @@ internal CommunicationIdentifierModel(string rawId, CommunicationUserIdentifierM /// The phone number. /// The Microsoft Teams user. /// The Microsoft Teams application. - /// Keeps track of any properties unknown to the library. - internal CommunicationIdentifierModel(AcsCommunicationIdentifierKind? kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, AcsMicrosoftTeamsAppIdentifier microsoftTeamsApp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CommunicationIdentifierModel(AcsCommunicationIdentifierKind? kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, AcsMicrosoftTeamsAppIdentifier microsoftTeamsApp, IDictionary additionalBinaryDataProperties) { Kind = kind; RawId = rawId; @@ -74,24 +41,24 @@ internal CommunicationIdentifierModel(AcsCommunicationIdentifierKind? kind, stri PhoneNumber = phoneNumber; MicrosoftTeamsUser = microsoftTeamsUser; MicrosoftTeamsApp = microsoftTeamsApp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CommunicationIdentifierModel() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The identifier kind. Only required in responses. public AcsCommunicationIdentifierKind? Kind { get; } + /// Raw Id of the identifier. Optional in requests, required in responses. public string RawId { get; } + /// The communication user. public CommunicationUserIdentifierModel CommunicationUser { get; } + /// The phone number. public PhoneNumberIdentifierModel PhoneNumber { get; } + /// The Microsoft Teams user. public MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get; } + /// The Microsoft Teams application. public AcsMicrosoftTeamsAppIdentifier MicrosoftTeamsApp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.Serialization.cs index f1c6e9510e13..3e24a70a7e5d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class CommunicationUserIdentifierModel : IUtf8JsonSerializable, IJsonModel + /// A user that got created with an Azure Communication Services resource. + public partial class CommunicationUserIdentifierModel : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CommunicationUserIdentifierModel() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +33,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CommunicationUserIdentifierModel)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CommunicationUserIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CommunicationUserIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CommunicationUserIdentifierModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CommunicationUserIdentifierModel)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCommunicationUserIdentifierModel(document.RootElement, options); } - internal static CommunicationUserIdentifierModel DeserializeCommunicationUserIdentifierModel(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CommunicationUserIdentifierModel DeserializeCommunicationUserIdentifierModel(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CommunicationUserIdentifierModel(id, serializedAdditionalRawData); + return new CommunicationUserIdentifierModel(id, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - CommunicationUserIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CommunicationUserIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CommunicationUserIdentifierModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCommunicationUserIdentifierModel(document.RootElement, options); } default: @@ -121,22 +136,7 @@ CommunicationUserIdentifierModel IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static CommunicationUserIdentifierModel FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCommunicationUserIdentifierModel(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.cs index 784344c1c5e2..5945487af8f9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationUserIdentifierModel.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// A user that got created with an Azure Communication Services resource. public partial class CommunicationUserIdentifierModel { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Id of the communication user. - /// is null. internal CommunicationUserIdentifierModel(string id) { - Argument.AssertNotNull(id, nameof(id)); - Id = id; } /// Initializes a new instance of . /// The Id of the communication user. - /// Keeps track of any properties unknown to the library. - internal CommunicationUserIdentifierModel(string id, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CommunicationUserIdentifierModel(string id, IDictionary additionalBinaryDataProperties) { Id = id; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CommunicationUserIdentifierModel() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Id of the communication user. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs index 3f48b544a18c..655368542a5f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// The content of the event request message. [JsonConverter(typeof(ContainerRegistryArtifactEventDataConverter))] - public partial class ContainerRegistryArtifactEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryArtifactEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryArtifactEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryArtifactEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); if (Optional.IsDefined(Timestamp)) @@ -54,15 +58,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("connectedRegistry"u8); writer.WriteObjectValue(ConnectedRegistry, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -71,22 +75,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryArtifactEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryArtifactEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryArtifactEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryArtifactEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryArtifactEventData(document.RootElement, options); } - internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryArtifactEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryArtifactEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -97,54 +106,52 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA string location = default; ContainerRegistryArtifactEventTarget target = default; ContainerRegistryEventConnectedRegistry connectedRegistry = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(property.Value, options); + target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(prop.Value, options); continue; } - if (property.NameEquals("connectedRegistry"u8)) + if (prop.NameEquals("connectedRegistry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); + connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryArtifactEventData( id, timestamp, @@ -152,13 +159,16 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA location, target, connectedRegistry, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -168,15 +178,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - ContainerRegistryArtifactEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryArtifactEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryArtifactEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryArtifactEventData(document.RootElement, options); } default: @@ -184,35 +199,28 @@ ContainerRegistryArtifactEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryArtifactEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryArtifactEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerRegistryArtifactEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerRegistryArtifactEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerRegistryArtifactEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerRegistryArtifactEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArtifactEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs index ae8dced1073a..d7b4ccae86f7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs @@ -13,51 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The content of the event request message. public partial class ContainerRegistryArtifactEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The event ID. /// The action that encompasses the provided event. /// The location of the event. /// The target of the event. - /// , , or is null. internal ContainerRegistryArtifactEventData(string id, string action, string location, ContainerRegistryArtifactEventTarget target) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(action, nameof(action)); - Argument.AssertNotNull(location, nameof(location)); - Argument.AssertNotNull(target, nameof(target)); - Id = id; Action = action; Location = location; @@ -71,8 +36,8 @@ internal ContainerRegistryArtifactEventData(string id, string action, string loc /// The location of the event. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary additionalBinaryDataProperties) { Id = id; Timestamp = timestamp; @@ -80,24 +45,24 @@ internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp Location = location; Target = target; ConnectedRegistry = connectedRegistry; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryArtifactEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The event ID. public string Id { get; } + /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The action that encompasses the provided event. public string Action { get; } + /// The location of the event. public string Location { get; } + /// The target of the event. public ContainerRegistryArtifactEventTarget Target { get; } + /// The connected registry information if the event is generated by a connected registry. public ContainerRegistryEventConnectedRegistry ConnectedRegistry { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.Serialization.cs index 82b4465aaa53..f9b4820e550a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ContainerRegistryArtifactEventTarget : IUtf8JsonSerializable, IJsonModel + /// The target of the event. + public partial class ContainerRegistryArtifactEventTarget : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryArtifactEventTarget() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryArtifactEventTarget)} does not support writing '{format}' format."); } - writer.WritePropertyName("mediaType"u8); writer.WriteStringValue(MediaType); if (Optional.IsDefined(Size)) @@ -63,15 +67,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("version"u8); writer.WriteStringValue(Version); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -80,22 +84,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryArtifactEventTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryArtifactEventTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryArtifactEventTarget JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryArtifactEventTarget)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryArtifactEventTarget(document.RootElement, options); } - internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistryArtifactEventTarget(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistryArtifactEventTarget(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -107,55 +116,53 @@ internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistr string tag = default; string name = default; string version = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("mediaType"u8)) + if (prop.NameEquals("mediaType"u8)) { - mediaType = property.Value.GetString(); + mediaType = prop.Value.GetString(); continue; } - if (property.NameEquals("size"u8)) + if (prop.NameEquals("size"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - size = property.Value.GetInt64(); + size = prop.Value.GetInt64(); continue; } - if (property.NameEquals("digest"u8)) + if (prop.NameEquals("digest"u8)) { - digest = property.Value.GetString(); + digest = prop.Value.GetString(); continue; } - if (property.NameEquals("repository"u8)) + if (prop.NameEquals("repository"u8)) { - repository = property.Value.GetString(); + repository = prop.Value.GetString(); continue; } - if (property.NameEquals("tag"u8)) + if (prop.NameEquals("tag"u8)) { - tag = property.Value.GetString(); + tag = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryArtifactEventTarget( mediaType, size, @@ -164,13 +171,16 @@ internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistr tag, name, version, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -180,15 +190,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - ContainerRegistryArtifactEventTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryArtifactEventTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryArtifactEventTarget PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryArtifactEventTarget(document.RootElement, options); } default: @@ -196,22 +211,7 @@ ContainerRegistryArtifactEventTarget IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryArtifactEventTarget FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryArtifactEventTarget(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.cs index c33a1758babc..30af397add3b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The target of the event. public partial class ContainerRegistryArtifactEventTarget { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The MIME type of the artifact. /// The repository name of the artifact. - /// or is null. internal ContainerRegistryArtifactEventTarget(string mediaType, string repository) { - Argument.AssertNotNull(mediaType, nameof(mediaType)); - Argument.AssertNotNull(repository, nameof(repository)); - MediaType = mediaType; Repository = repository; } @@ -66,8 +33,8 @@ internal ContainerRegistryArtifactEventTarget(string mediaType, string repositor /// The tag of the artifact. /// The name of the artifact. /// The version of the artifact. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryArtifactEventTarget(string mediaType, long? size, string digest, string repository, string tag, string name, string version, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryArtifactEventTarget(string mediaType, long? size, string digest, string repository, string tag, string name, string version, IDictionary additionalBinaryDataProperties) { MediaType = mediaType; Size = size; @@ -76,26 +43,27 @@ internal ContainerRegistryArtifactEventTarget(string mediaType, long? size, stri Tag = tag; Name = name; Version = version; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryArtifactEventTarget() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The MIME type of the artifact. public string MediaType { get; } + /// The size in bytes of the artifact. public long? Size { get; } + /// The digest of the artifact. public string Digest { get; } + /// The repository name of the artifact. public string Repository { get; } + /// The tag of the artifact. public string Tag { get; } + /// The name of the artifact. public string Name { get; } + /// The version of the artifact. public string Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs index c69e327b1f99..bac5eaeb3f7b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event. [JsonConverter(typeof(ContainerRegistryChartDeletedEventDataConverter))] - public partial class ContainerRegistryChartDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryChartDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryChartDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryChartDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerRegistryChartDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryChartDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerRegistryChartDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerRegistryArtifactEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryChartDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryChartDeletedEventData(document.RootElement, options); } - internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegistryChartDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegistryChartDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -65,54 +74,52 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis string location = default; ContainerRegistryArtifactEventTarget target = default; ContainerRegistryEventConnectedRegistry connectedRegistry = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(property.Value, options); + target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(prop.Value, options); continue; } - if (property.NameEquals("connectedRegistry"u8)) + if (prop.NameEquals("connectedRegistry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); + connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryChartDeletedEventData( id, timestamp, @@ -120,13 +127,16 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis location, target, connectedRegistry, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +146,20 @@ BinaryData IPersistableModel.Write(Model } } - ContainerRegistryChartDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryChartDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerRegistryChartDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerRegistryArtifactEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryChartDeletedEventData(document.RootElement, options); } default: @@ -152,35 +167,28 @@ ContainerRegistryChartDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerRegistryChartDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryChartDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerRegistryChartDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerRegistryChartDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerRegistryChartDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerRegistryChartDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryChartDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs index 8cf7aa2797a8..f5406ec0b166 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs @@ -18,13 +18,8 @@ public partial class ContainerRegistryChartDeletedEventData : ContainerRegistryA /// The action that encompasses the provided event. /// The location of the event. /// The target of the event. - /// , , or is null. internal ContainerRegistryChartDeletedEventData(string id, string action, string location, ContainerRegistryArtifactEventTarget target) : base(id, action, location, target) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(action, nameof(action)); - Argument.AssertNotNull(location, nameof(location)); - Argument.AssertNotNull(target, nameof(target)); } /// Initializes a new instance of . @@ -34,13 +29,8 @@ internal ContainerRegistryChartDeletedEventData(string id, string action, string /// The location of the event. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryChartDeletedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary additionalBinaryDataProperties) : base(id, timestamp, action, location, target, connectedRegistry, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs index 1a3828931e20..65274dcc70a7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event. [JsonConverter(typeof(ContainerRegistryChartPushedEventDataConverter))] - public partial class ContainerRegistryChartPushedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryChartPushedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryChartPushedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryChartPushedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerRegistryChartPushedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryChartPushedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerRegistryChartPushedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerRegistryArtifactEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryChartPushedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryChartPushedEventData(document.RootElement, options); } - internal static ContainerRegistryChartPushedEventData DeserializeContainerRegistryChartPushedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryChartPushedEventData DeserializeContainerRegistryChartPushedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -65,54 +74,52 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist string location = default; ContainerRegistryArtifactEventTarget target = default; ContainerRegistryEventConnectedRegistry connectedRegistry = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(property.Value, options); + target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(prop.Value, options); continue; } - if (property.NameEquals("connectedRegistry"u8)) + if (prop.NameEquals("connectedRegistry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); + connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryChartPushedEventData( id, timestamp, @@ -120,13 +127,16 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist location, target, connectedRegistry, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +146,20 @@ BinaryData IPersistableModel.Write(ModelR } } - ContainerRegistryChartPushedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryChartPushedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerRegistryChartPushedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerRegistryArtifactEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryChartPushedEventData(document.RootElement, options); } default: @@ -152,35 +167,28 @@ ContainerRegistryChartPushedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerRegistryChartPushedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryChartPushedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerRegistryChartPushedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerRegistryChartPushedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerRegistryChartPushedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerRegistryChartPushedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryChartPushedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs index ca4482c21288..d4af4ed20760 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs @@ -18,13 +18,8 @@ public partial class ContainerRegistryChartPushedEventData : ContainerRegistryAr /// The action that encompasses the provided event. /// The location of the event. /// The target of the event. - /// , , or is null. internal ContainerRegistryChartPushedEventData(string id, string action, string location, ContainerRegistryArtifactEventTarget target) : base(id, action, location, target) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(action, nameof(action)); - Argument.AssertNotNull(location, nameof(location)); - Argument.AssertNotNull(target, nameof(target)); } /// Initializes a new instance of . @@ -34,13 +29,8 @@ internal ContainerRegistryChartPushedEventData(string id, string action, string /// The location of the event. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryChartPushedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary additionalBinaryDataProperties) : base(id, timestamp, action, location, target, connectedRegistry, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.Serialization.cs index baad2a0ff3f5..412241106c65 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ContainerRegistryEventActor : IUtf8JsonSerializable, IJsonModel + /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. + public partial class ContainerRegistryEventActor : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventActor)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,49 +55,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryEventActor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryEventActor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventActor JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventActor)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryEventActor(document.RootElement, options); } - internal static ContainerRegistryEventActor DeserializeContainerRegistryEventActor(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryEventActor DeserializeContainerRegistryEventActor(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryEventActor(name, serializedAdditionalRawData); + return new ContainerRegistryEventActor(name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -108,15 +113,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - ContainerRegistryEventActor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryEventActor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventActor PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryEventActor(document.RootElement, options); } default: @@ -124,22 +134,7 @@ ContainerRegistryEventActor IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryEventActor FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryEventActor(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.cs index feb212ebef28..18cfdf826104 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventActor.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. public partial class ContainerRegistryEventActor { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ContainerRegistryEventActor() @@ -52,11 +23,11 @@ internal ContainerRegistryEventActor() /// Initializes a new instance of . /// The subject or username associated with the request context that generated the event. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventActor(string name, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryEventActor(string name, IDictionary additionalBinaryDataProperties) { Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The subject or username associated with the request context that generated the event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.Serialization.cs index 5f907b587822..af65d1f9e5e8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ContainerRegistryEventConnectedRegistry : IUtf8JsonSerializable, IJsonModel + /// The connected registry information if the event is generated by a connected registry. + public partial class ContainerRegistryEventConnectedRegistry : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryEventConnectedRegistry() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +33,22 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventConnectedRegistry)} does not support writing '{format}' format."); } - writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryEventConnectedRegistry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryEventConnectedRegistry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventConnectedRegistry JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventConnectedRegistry)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryEventConnectedRegistry(document.RootElement, options); } - internal static ContainerRegistryEventConnectedRegistry DeserializeContainerRegistryEventConnectedRegistry(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryEventConnectedRegistry DeserializeContainerRegistryEventConnectedRegistry(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryEventConnectedRegistry(name, serializedAdditionalRawData); + return new ContainerRegistryEventConnectedRegistry(name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +115,20 @@ BinaryData IPersistableModel.Write(Mode } } - ContainerRegistryEventConnectedRegistry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryEventConnectedRegistry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventConnectedRegistry PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryEventConnectedRegistry(document.RootElement, options); } default: @@ -121,22 +136,7 @@ ContainerRegistryEventConnectedRegistry IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryEventConnectedRegistry FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryEventConnectedRegistry(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.cs index e39009f58d84..f0b5b61f2656 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The connected registry information if the event is generated by a connected registry. public partial class ContainerRegistryEventConnectedRegistry { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The name of the connected registry that generated this event. - /// is null. internal ContainerRegistryEventConnectedRegistry(string name) { - Argument.AssertNotNull(name, nameof(name)); - Name = name; } /// Initializes a new instance of . /// The name of the connected registry that generated this event. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventConnectedRegistry(string name, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryEventConnectedRegistry(string name, IDictionary additionalBinaryDataProperties) { Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryEventConnectedRegistry() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the connected registry that generated this event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs index 15c76c54ad88..dd4215662539 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// The content of the event request message. [JsonConverter(typeof(ContainerRegistryEventDataConverter))] - public partial class ContainerRegistryEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); if (Optional.IsDefined(Timestamp)) @@ -69,15 +73,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("connectedRegistry"u8); writer.WriteObjectValue(ConnectedRegistry, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +90,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryEventData(document.RootElement, options); } - internal static ContainerRegistryEventData DeserializeContainerRegistryEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryEventData DeserializeContainerRegistryEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,81 +124,79 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData ContainerRegistryEventActor actor = default; ContainerRegistryEventSource source = default; ContainerRegistryEventConnectedRegistry connectedRegistry = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(property.Value, options); + target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(prop.Value, options); continue; } - if (property.NameEquals("request"u8)) + if (prop.NameEquals("request"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value, options); + request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(prop.Value, options); continue; } - if (property.NameEquals("actor"u8)) + if (prop.NameEquals("actor"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value, options); + actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(prop.Value, options); continue; } - if (property.NameEquals("source"u8)) + if (prop.NameEquals("source"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value, options); + source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(prop.Value, options); continue; } - if (property.NameEquals("connectedRegistry"u8)) + if (prop.NameEquals("connectedRegistry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); + connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryEventData( id, timestamp, @@ -200,13 +207,16 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData actor, source, connectedRegistry, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -216,15 +226,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - ContainerRegistryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryEventData(document.RootElement, options); } default: @@ -232,35 +247,28 @@ ContainerRegistryEventData IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerRegistryEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerRegistryEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerRegistryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerRegistryEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs index c576dad7a791..d63e1fafa349 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs @@ -13,51 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The content of the event request message. public partial class ContainerRegistryEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The event ID. /// The action that encompasses the provided event. /// The location of the event. /// The target of the event. - /// , , or is null. internal ContainerRegistryEventData(string id, string action, string location, ContainerRegistryEventTarget target) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(action, nameof(action)); - Argument.AssertNotNull(location, nameof(location)); - Argument.AssertNotNull(target, nameof(target)); - Id = id; Action = action; Location = location; @@ -74,8 +39,8 @@ internal ContainerRegistryEventData(string id, string action, string location, C /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary additionalBinaryDataProperties) { Id = id; Timestamp = timestamp; @@ -86,30 +51,33 @@ internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string Actor = actor; Source = source; ConnectedRegistry = connectedRegistry; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The event ID. public string Id { get; } + /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The action that encompasses the provided event. public string Action { get; } + /// The location of the event. public string Location { get; } + /// The target of the event. public ContainerRegistryEventTarget Target { get; } + /// The request that generated the event. public ContainerRegistryEventRequest Request { get; } + /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. public ContainerRegistryEventActor Actor { get; } + /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. public ContainerRegistryEventSource Source { get; } + /// The connected registry information if the event is generated by a connected registry. public ContainerRegistryEventConnectedRegistry ConnectedRegistry { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.Serialization.cs index 5e0495da0781..d264a3e2417a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ContainerRegistryEventRequest : IUtf8JsonSerializable, IJsonModel + /// The request that generated the event. + public partial class ContainerRegistryEventRequest : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryEventRequest() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventRequest)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); if (Optional.IsDefined(Addr)) @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("useragent"u8); writer.WriteStringValue(Useragent); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,22 +71,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryEventRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryEventRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventRequest JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventRequest)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryEventRequest(document.RootElement, options); } - internal static ContainerRegistryEventRequest DeserializeContainerRegistryEventRequest(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryEventRequest DeserializeContainerRegistryEventRequest(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -90,56 +99,57 @@ internal static ContainerRegistryEventRequest DeserializeContainerRegistryEventR string id = default; string addr = default; string host = default; - string method = default; + string @method = default; string useragent = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("addr"u8)) + if (prop.NameEquals("addr"u8)) { - addr = property.Value.GetString(); + addr = prop.Value.GetString(); continue; } - if (property.NameEquals("host"u8)) + if (prop.NameEquals("host"u8)) { - host = property.Value.GetString(); + host = prop.Value.GetString(); continue; } - if (property.NameEquals("method"u8)) + if (prop.NameEquals("method"u8)) { - method = property.Value.GetString(); + @method = prop.Value.GetString(); continue; } - if (property.NameEquals("useragent"u8)) + if (prop.NameEquals("useragent"u8)) { - useragent = property.Value.GetString(); + useragent = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryEventRequest( id, addr, host, - method, + @method, useragent, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -149,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ContainerRegistryEventRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryEventRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventRequest PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryEventRequest(document.RootElement, options); } default: @@ -165,22 +180,7 @@ ContainerRegistryEventRequest IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryEventRequest FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryEventRequest(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.cs index 96ca17beee49..2d7d55e10b0e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.cs @@ -13,52 +13,18 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The request that generated the event. public partial class ContainerRegistryEventRequest { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The ID of the request that initiated the event. /// The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. /// The request method that generated the event. - /// , or is null. - internal ContainerRegistryEventRequest(string id, string host, string method) + internal ContainerRegistryEventRequest(string id, string host, string @method) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(host, nameof(host)); - Argument.AssertNotNull(method, nameof(method)); - Id = id; Host = host; - Method = method; + Method = @method; } /// Initializes a new instance of . @@ -67,30 +33,29 @@ internal ContainerRegistryEventRequest(string id, string host, string method) /// The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. /// The request method that generated the event. /// The user agent header of the request. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventRequest(string id, string addr, string host, string method, string useragent, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryEventRequest(string id, string addr, string host, string @method, string useragent, IDictionary additionalBinaryDataProperties) { Id = id; Addr = addr; Host = host; - Method = method; + Method = @method; Useragent = useragent; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryEventRequest() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ID of the request that initiated the event. public string Id { get; } + /// The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. public string Addr { get; } + /// The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. public string Host { get; } + /// The request method that generated the event. public string Method { get; } + /// The user agent header of the request. public string Useragent { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.Serialization.cs index de445dbe1178..79bda1c8e6f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ContainerRegistryEventSource : IUtf8JsonSerializable, IJsonModel + /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + public partial class ContainerRegistryEventSource : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventSource)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Addr)) { writer.WritePropertyName("addr"u8); @@ -44,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("instanceID"u8); writer.WriteStringValue(InstanceID); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryEventSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryEventSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryEventSource(document.RootElement, options); } - internal static ContainerRegistryEventSource DeserializeContainerRegistryEventSource(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryEventSource DeserializeContainerRegistryEventSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string addr = default; string instanceID = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("addr"u8)) + if (prop.NameEquals("addr"u8)) { - addr = property.Value.GetString(); + addr = prop.Value.GetString(); continue; } - if (property.NameEquals("instanceID"u8)) + if (prop.NameEquals("instanceID"u8)) { - instanceID = property.Value.GetString(); + instanceID = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerRegistryEventSource(addr, instanceID, serializedAdditionalRawData); + return new ContainerRegistryEventSource(addr, instanceID, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - ContainerRegistryEventSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryEventSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryEventSource(document.RootElement, options); } default: @@ -135,22 +145,7 @@ ContainerRegistryEventSource IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryEventSource FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryEventSource(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.cs index 7164efbf89ab..0bfb12e057ba 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventSource.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. public partial class ContainerRegistryEventSource { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ContainerRegistryEventSource() @@ -53,16 +24,17 @@ internal ContainerRegistryEventSource() /// Initializes a new instance of . /// The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. /// The running instance of an application. Changes after each restart. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventSource(string addr, string instanceID, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryEventSource(string addr, string instanceID, IDictionary additionalBinaryDataProperties) { Addr = addr; InstanceID = instanceID; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. public string Addr { get; } + /// The running instance of an application. Changes after each restart. public string InstanceID { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.Serialization.cs index e7fab4468a24..bd3a74524556 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ContainerRegistryEventTarget : IUtf8JsonSerializable, IJsonModel + /// The target of the event. + public partial class ContainerRegistryEventTarget : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryEventTarget() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventTarget)} does not support writing '{format}' format."); } - writer.WritePropertyName("mediaType"u8); writer.WriteStringValue(MediaType); if (Optional.IsDefined(Size)) @@ -63,15 +67,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("tag"u8); writer.WriteStringValue(Tag); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -80,22 +84,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerRegistryEventTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryEventTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventTarget JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryEventTarget)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryEventTarget(document.RootElement, options); } - internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTarget(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTarget(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -107,59 +116,57 @@ internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTa string repository = default; string url = default; string tag = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("mediaType"u8)) + if (prop.NameEquals("mediaType"u8)) { - mediaType = property.Value.GetString(); + mediaType = prop.Value.GetString(); continue; } - if (property.NameEquals("size"u8)) + if (prop.NameEquals("size"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - size = property.Value.GetInt64(); + size = prop.Value.GetInt64(); continue; } - if (property.NameEquals("digest"u8)) + if (prop.NameEquals("digest"u8)) { - digest = property.Value.GetString(); + digest = prop.Value.GetString(); continue; } - if (property.NameEquals("length"u8)) + if (prop.NameEquals("length"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - length = property.Value.GetInt64(); + length = prop.Value.GetInt64(); continue; } - if (property.NameEquals("repository"u8)) + if (prop.NameEquals("repository"u8)) { - repository = property.Value.GetString(); + repository = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("tag"u8)) + if (prop.NameEquals("tag"u8)) { - tag = property.Value.GetString(); + tag = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryEventTarget( mediaType, size, @@ -168,13 +175,16 @@ internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTa repository, url, tag, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -184,15 +194,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - ContainerRegistryEventTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryEventTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerRegistryEventTarget PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryEventTarget(document.RootElement, options); } default: @@ -200,22 +215,7 @@ ContainerRegistryEventTarget IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerRegistryEventTarget FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryEventTarget(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.cs index c7d5aecf612a..608751c1c4ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The target of the event. public partial class ContainerRegistryEventTarget { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The MIME type of the referenced object. /// The repository name. - /// or is null. internal ContainerRegistryEventTarget(string mediaType, string repository) { - Argument.AssertNotNull(mediaType, nameof(mediaType)); - Argument.AssertNotNull(repository, nameof(repository)); - MediaType = mediaType; Repository = repository; } @@ -66,8 +33,8 @@ internal ContainerRegistryEventTarget(string mediaType, string repository) /// The repository name. /// The direct URL to the content. /// The tag name. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventTarget(string mediaType, long? size, string digest, long? length, string repository, string url, string tag, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryEventTarget(string mediaType, long? size, string digest, long? length, string repository, string url, string tag, IDictionary additionalBinaryDataProperties) { MediaType = mediaType; Size = size; @@ -76,26 +43,27 @@ internal ContainerRegistryEventTarget(string mediaType, long? size, string diges Repository = repository; Url = url; Tag = tag; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryEventTarget() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The MIME type of the referenced object. public string MediaType { get; } + /// The number of bytes of the content. Same as Length field. public long? Size { get; } + /// The digest of the content, as defined by the Registry V2 HTTP API Specification. public string Digest { get; } + /// The number of bytes of the content. Same as Size field. public long? Length { get; } + /// The repository name. public string Repository { get; } + /// The direct URL to the content. public string Url { get; } + /// The tag name. public string Tag { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs index 1ad89d2d90b4..e310491aa924 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event. [JsonConverter(typeof(ContainerRegistryImageDeletedEventDataConverter))] - public partial class ContainerRegistryImageDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryImageDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryImageDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryImageDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerRegistryImageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryImageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerRegistryImageDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerRegistryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryImageDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryImageDeletedEventData(document.RootElement, options); } - internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegistryImageDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegistryImageDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -68,81 +77,79 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis ContainerRegistryEventActor actor = default; ContainerRegistryEventSource source = default; ContainerRegistryEventConnectedRegistry connectedRegistry = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(property.Value, options); + target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(prop.Value, options); continue; } - if (property.NameEquals("request"u8)) + if (prop.NameEquals("request"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value, options); + request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(prop.Value, options); continue; } - if (property.NameEquals("actor"u8)) + if (prop.NameEquals("actor"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value, options); + actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(prop.Value, options); continue; } - if (property.NameEquals("source"u8)) + if (prop.NameEquals("source"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value, options); + source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(prop.Value, options); continue; } - if (property.NameEquals("connectedRegistry"u8)) + if (prop.NameEquals("connectedRegistry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); + connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryImageDeletedEventData( id, timestamp, @@ -153,13 +160,16 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis actor, source, connectedRegistry, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -169,15 +179,20 @@ BinaryData IPersistableModel.Write(Model } } - ContainerRegistryImageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryImageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerRegistryImageDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerRegistryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryImageDeletedEventData(document.RootElement, options); } default: @@ -185,35 +200,28 @@ ContainerRegistryImageDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerRegistryImageDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryImageDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerRegistryImageDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerRegistryImageDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerRegistryImageDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerRegistryImageDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryImageDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs index eaee919d7c56..65dd16bfda88 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs @@ -18,13 +18,8 @@ public partial class ContainerRegistryImageDeletedEventData : ContainerRegistryE /// The action that encompasses the provided event. /// The location of the event. /// The target of the event. - /// , , or is null. internal ContainerRegistryImageDeletedEventData(string id, string action, string location, ContainerRegistryEventTarget target) : base(id, action, location, target) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(action, nameof(action)); - Argument.AssertNotNull(location, nameof(location)); - Argument.AssertNotNull(target, nameof(target)); } /// Initializes a new instance of . @@ -37,13 +32,8 @@ internal ContainerRegistryImageDeletedEventData(string id, string action, string /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryImageDeletedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary additionalBinaryDataProperties) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs index 9c4fb3863c3c..4b7f6267d6b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event. [JsonConverter(typeof(ContainerRegistryImagePushedEventDataConverter))] - public partial class ContainerRegistryImagePushedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerRegistryImagePushedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerRegistryImagePushedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryImagePushedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerRegistryImagePushedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerRegistryImagePushedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerRegistryImagePushedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerRegistryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerRegistryImagePushedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerRegistryImagePushedEventData(document.RootElement, options); } - internal static ContainerRegistryImagePushedEventData DeserializeContainerRegistryImagePushedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerRegistryImagePushedEventData DeserializeContainerRegistryImagePushedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -68,81 +77,79 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist ContainerRegistryEventActor actor = default; ContainerRegistryEventSource source = default; ContainerRegistryEventConnectedRegistry connectedRegistry = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("target"u8)) + if (prop.NameEquals("target"u8)) { - target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(property.Value, options); + target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(prop.Value, options); continue; } - if (property.NameEquals("request"u8)) + if (prop.NameEquals("request"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value, options); + request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(prop.Value, options); continue; } - if (property.NameEquals("actor"u8)) + if (prop.NameEquals("actor"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value, options); + actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(prop.Value, options); continue; } - if (property.NameEquals("source"u8)) + if (prop.NameEquals("source"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value, options); + source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(prop.Value, options); continue; } - if (property.NameEquals("connectedRegistry"u8)) + if (prop.NameEquals("connectedRegistry"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); + connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ContainerRegistryImagePushedEventData( id, timestamp, @@ -153,13 +160,16 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist actor, source, connectedRegistry, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -169,15 +179,20 @@ BinaryData IPersistableModel.Write(ModelR } } - ContainerRegistryImagePushedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerRegistryImagePushedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerRegistryImagePushedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerRegistryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerRegistryImagePushedEventData(document.RootElement, options); } default: @@ -185,35 +200,28 @@ ContainerRegistryImagePushedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerRegistryImagePushedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerRegistryImagePushedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerRegistryImagePushedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerRegistryImagePushedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerRegistryImagePushedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerRegistryImagePushedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryImagePushedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs index fc790eefe615..3516909d9cac 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs @@ -18,13 +18,8 @@ public partial class ContainerRegistryImagePushedEventData : ContainerRegistryEv /// The action that encompasses the provided event. /// The location of the event. /// The target of the event. - /// , , or is null. internal ContainerRegistryImagePushedEventData(string id, string action, string location, ContainerRegistryEventTarget target) : base(id, action, location, target) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(action, nameof(action)); - Argument.AssertNotNull(location, nameof(location)); - Argument.AssertNotNull(target, nameof(target)); } /// Initializes a new instance of . @@ -37,13 +32,8 @@ internal ContainerRegistryImagePushedEventData(string id, string action, string /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. - /// Keeps track of any properties unknown to the library. - internal ContainerRegistryImagePushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerRegistryImagePushedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryImagePushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary additionalBinaryDataProperties) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.Serialization.cs index 596704ca06e3..49d8ba4af4e3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.ClusterSupportEnded event. [JsonConverter(typeof(ContainerServiceClusterSupportEndedEventDataConverter))] - public partial class ContainerServiceClusterSupportEndedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceClusterSupportEndedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceClusterSupportEndedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceClusterSupportEndedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerServiceClusterSupportEndedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceClusterSupportEndedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerServiceClusterSupportEndedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerServiceClusterSupportEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceClusterSupportEndedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceClusterSupportEndedEventData(document.RootElement, options); } - internal static ContainerServiceClusterSupportEndedEventData DeserializeContainerServiceClusterSupportEndedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceClusterSupportEndedEventData DeserializeContainerServiceClusterSupportEndedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string kubernetesVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("kubernetesVersion"u8)) + if (prop.NameEquals("kubernetesVersion"u8)) { - kubernetesVersion = property.Value.GetString(); + kubernetesVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceClusterSupportEndedEventData(kubernetesVersion, serializedAdditionalRawData); + return new ContainerServiceClusterSupportEndedEventData(kubernetesVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel.Write } } - ContainerServiceClusterSupportEndedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceClusterSupportEndedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerServiceClusterSupportEndedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerServiceClusterSupportEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceClusterSupportEndedEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ ContainerServiceClusterSupportEndedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerServiceClusterSupportEndedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceClusterSupportEndedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceClusterSupportEndedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceClusterSupportEndedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceClusterSupportEndedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceClusterSupportEndedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceClusterSupportEndedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.cs index ef80f3e0864a..404133d84fc2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndedEventData.cs @@ -15,21 +15,14 @@ public partial class ContainerServiceClusterSupportEndedEventData : ContainerSer { /// Initializes a new instance of . /// The Kubernetes version of the ManagedCluster resource. - /// is null. internal ContainerServiceClusterSupportEndedEventData(string kubernetesVersion) : base(kubernetesVersion) { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); } /// Initializes a new instance of . /// The Kubernetes version of the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceClusterSupportEndedEventData(string kubernetesVersion, IDictionary serializedAdditionalRawData) : base(kubernetesVersion, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceClusterSupportEndedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerServiceClusterSupportEndedEventData(string kubernetesVersion, IDictionary additionalBinaryDataProperties) : base(kubernetesVersion, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.Serialization.cs index dcf7fd6175a0..4c5c34a1f6ae 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.ClusterSupportEnding event. [JsonConverter(typeof(ContainerServiceClusterSupportEndingEventDataConverter))] - public partial class ContainerServiceClusterSupportEndingEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceClusterSupportEndingEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceClusterSupportEndingEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceClusterSupportEndingEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerServiceClusterSupportEndingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceClusterSupportEndingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerServiceClusterSupportEndingEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerServiceClusterSupportEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceClusterSupportEndingEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceClusterSupportEndingEventData(document.RootElement, options); } - internal static ContainerServiceClusterSupportEndingEventData DeserializeContainerServiceClusterSupportEndingEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceClusterSupportEndingEventData DeserializeContainerServiceClusterSupportEndingEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string kubernetesVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("kubernetesVersion"u8)) + if (prop.NameEquals("kubernetesVersion"u8)) { - kubernetesVersion = property.Value.GetString(); + kubernetesVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceClusterSupportEndingEventData(kubernetesVersion, serializedAdditionalRawData); + return new ContainerServiceClusterSupportEndingEventData(kubernetesVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel.Writ } } - ContainerServiceClusterSupportEndingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceClusterSupportEndingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerServiceClusterSupportEndingEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerServiceClusterSupportEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceClusterSupportEndingEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ ContainerServiceClusterSupportEndingEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerServiceClusterSupportEndingEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceClusterSupportEndingEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceClusterSupportEndingEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceClusterSupportEndingEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceClusterSupportEndingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceClusterSupportEndingEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceClusterSupportEndingEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.cs index ea696b7348fe..cb1252ee4fa5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEndingEventData.cs @@ -15,21 +15,14 @@ public partial class ContainerServiceClusterSupportEndingEventData : ContainerSe { /// Initializes a new instance of . /// The Kubernetes version of the ManagedCluster resource. - /// is null. internal ContainerServiceClusterSupportEndingEventData(string kubernetesVersion) : base(kubernetesVersion) { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); } /// Initializes a new instance of . /// The Kubernetes version of the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceClusterSupportEndingEventData(string kubernetesVersion, IDictionary serializedAdditionalRawData) : base(kubernetesVersion, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceClusterSupportEndingEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerServiceClusterSupportEndingEventData(string kubernetesVersion, IDictionary additionalBinaryDataProperties) : base(kubernetesVersion, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.Serialization.cs index b34be5994a30..2497b96be8f0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of cluster support events. [JsonConverter(typeof(ContainerServiceClusterSupportEventDataConverter))] - public partial class ContainerServiceClusterSupportEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceClusterSupportEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceClusterSupportEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,23 +35,22 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceClusterSupportEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("kubernetesVersion"u8); writer.WriteStringValue(KubernetesVersion); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,49 +59,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerServiceClusterSupportEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceClusterSupportEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerServiceClusterSupportEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceClusterSupportEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceClusterSupportEventData(document.RootElement, options); } - internal static ContainerServiceClusterSupportEventData DeserializeContainerServiceClusterSupportEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceClusterSupportEventData DeserializeContainerServiceClusterSupportEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string kubernetesVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("kubernetesVersion"u8)) + if (prop.NameEquals("kubernetesVersion"u8)) { - kubernetesVersion = property.Value.GetString(); + kubernetesVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceClusterSupportEventData(kubernetesVersion, serializedAdditionalRawData); + return new ContainerServiceClusterSupportEventData(kubernetesVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +117,20 @@ BinaryData IPersistableModel.Write(Mode } } - ContainerServiceClusterSupportEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceClusterSupportEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerServiceClusterSupportEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceClusterSupportEventData(document.RootElement, options); } default: @@ -123,35 +138,28 @@ ContainerServiceClusterSupportEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerServiceClusterSupportEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceClusterSupportEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceClusterSupportEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceClusterSupportEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceClusterSupportEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceClusterSupportEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceClusterSupportEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.cs index d6720cabcd35..e37430cf9330 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceClusterSupportEventData.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of cluster support events. public partial class ContainerServiceClusterSupportEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Kubernetes version of the ManagedCluster resource. - /// is null. internal ContainerServiceClusterSupportEventData(string kubernetesVersion) { - Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion)); - KubernetesVersion = kubernetesVersion; } /// Initializes a new instance of . /// The Kubernetes version of the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceClusterSupportEventData(string kubernetesVersion, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerServiceClusterSupportEventData(string kubernetesVersion, IDictionary additionalBinaryDataProperties) { KubernetesVersion = kubernetesVersion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceClusterSupportEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Kubernetes version of the ManagedCluster resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.Serialization.cs index 3aeb222101d3..b03a99d68cc9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event. [JsonConverter(typeof(ContainerServiceNewKubernetesVersionAvailableEventDataConverter))] - public partial class ContainerServiceNewKubernetesVersionAvailableEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceNewKubernetesVersionAvailableEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceNewKubernetesVersionAvailableEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Ut /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNewKubernetesVersionAvailableEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("latestSupportedKubernetesVersion"u8); writer.WriteStringValue(LatestSupportedKubernetesVersion); writer.WritePropertyName("latestStableKubernetesVersion"u8); @@ -47,15 +51,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("latestPreviewKubernetesVersion"u8); writer.WriteStringValue(LatestPreviewKubernetesVersion); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -64,22 +68,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerServiceNewKubernetesVersionAvailableEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceNewKubernetesVersionAvailableEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerServiceNewKubernetesVersionAvailableEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNewKubernetesVersionAvailableEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceNewKubernetesVersionAvailableEventData(document.RootElement, options); } - internal static ContainerServiceNewKubernetesVersionAvailableEventData DeserializeContainerServiceNewKubernetesVersionAvailableEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceNewKubernetesVersionAvailableEventData DeserializeContainerServiceNewKubernetesVersionAvailableEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,43 +97,44 @@ internal static ContainerServiceNewKubernetesVersionAvailableEventData Deseriali string latestStableKubernetesVersion = default; string lowestMinorKubernetesVersion = default; string latestPreviewKubernetesVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("latestSupportedKubernetesVersion"u8)) + if (prop.NameEquals("latestSupportedKubernetesVersion"u8)) { - latestSupportedKubernetesVersion = property.Value.GetString(); + latestSupportedKubernetesVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("latestStableKubernetesVersion"u8)) + if (prop.NameEquals("latestStableKubernetesVersion"u8)) { - latestStableKubernetesVersion = property.Value.GetString(); + latestStableKubernetesVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("lowestMinorKubernetesVersion"u8)) + if (prop.NameEquals("lowestMinorKubernetesVersion"u8)) { - lowestMinorKubernetesVersion = property.Value.GetString(); + lowestMinorKubernetesVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("latestPreviewKubernetesVersion"u8)) + if (prop.NameEquals("latestPreviewKubernetesVersion"u8)) { - latestPreviewKubernetesVersion = property.Value.GetString(); + latestPreviewKubernetesVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceNewKubernetesVersionAvailableEventData(latestSupportedKubernetesVersion, latestStableKubernetesVersion, lowestMinorKubernetesVersion, latestPreviewKubernetesVersion, serializedAdditionalRawData); + return new ContainerServiceNewKubernetesVersionAvailableEventData(latestSupportedKubernetesVersion, latestStableKubernetesVersion, lowestMinorKubernetesVersion, latestPreviewKubernetesVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +144,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceNewKubernetesVersionAvailableEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerServiceNewKubernetesVersionAvailableEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceNewKubernetesVersionAvailableEventData(document.RootElement, options); } default: @@ -150,35 +165,28 @@ ContainerServiceNewKubernetesVersionAvailableEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerServiceNewKubernetesVersionAvailableEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceNewKubernetesVersionAvailableEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceNewKubernetesVersionAvailableEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceNewKubernetesVersionAvailableEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceNewKubernetesVersionAvailableEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNewKubernetesVersionAvailableEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceNewKubernetesVersionAvailableEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.cs index c27879af09ee..cc4677b0c854 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNewKubernetesVersionAvailableEventData.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event. public partial class ContainerServiceNewKubernetesVersionAvailableEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource. /// The highest PATCH Kubernetes version for the MINOR version considered stable for the ManagedCluster resource. /// The highest PATCH Kubernetes version for the lowest applicable MINOR version available for the ManagedCluster resource. - /// , or is null. internal ContainerServiceNewKubernetesVersionAvailableEventData(string latestSupportedKubernetesVersion, string latestStableKubernetesVersion, string lowestMinorKubernetesVersion) { - Argument.AssertNotNull(latestSupportedKubernetesVersion, nameof(latestSupportedKubernetesVersion)); - Argument.AssertNotNull(latestStableKubernetesVersion, nameof(latestStableKubernetesVersion)); - Argument.AssertNotNull(lowestMinorKubernetesVersion, nameof(lowestMinorKubernetesVersion)); - LatestSupportedKubernetesVersion = latestSupportedKubernetesVersion; LatestStableKubernetesVersion = latestStableKubernetesVersion; LowestMinorKubernetesVersion = lowestMinorKubernetesVersion; @@ -66,27 +32,25 @@ internal ContainerServiceNewKubernetesVersionAvailableEventData(string latestSup /// The highest PATCH Kubernetes version for the MINOR version considered stable for the ManagedCluster resource. /// The highest PATCH Kubernetes version for the lowest applicable MINOR version available for the ManagedCluster resource. /// The highest PATCH Kubernetes version considered preview for the ManagedCluster resource. There might not be any version in preview at the time of publishing the event. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNewKubernetesVersionAvailableEventData(string latestSupportedKubernetesVersion, string latestStableKubernetesVersion, string lowestMinorKubernetesVersion, string latestPreviewKubernetesVersion, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerServiceNewKubernetesVersionAvailableEventData(string latestSupportedKubernetesVersion, string latestStableKubernetesVersion, string lowestMinorKubernetesVersion, string latestPreviewKubernetesVersion, IDictionary additionalBinaryDataProperties) { LatestSupportedKubernetesVersion = latestSupportedKubernetesVersion; LatestStableKubernetesVersion = latestStableKubernetesVersion; LowestMinorKubernetesVersion = lowestMinorKubernetesVersion; LatestPreviewKubernetesVersion = latestPreviewKubernetesVersion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceNewKubernetesVersionAvailableEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource. public string LatestSupportedKubernetesVersion { get; } + /// The highest PATCH Kubernetes version for the MINOR version considered stable for the ManagedCluster resource. public string LatestStableKubernetesVersion { get; } + /// The highest PATCH Kubernetes version for the lowest applicable MINOR version available for the ManagedCluster resource. public string LowestMinorKubernetesVersion { get; } + /// The highest PATCH Kubernetes version considered preview for the ManagedCluster resource. There might not be any version in preview at the time of publishing the event. public string LatestPreviewKubernetesVersion { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.Serialization.cs index 69b402dd3d9f..5939b82bffd9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of common properties of node pool rolling events. [JsonConverter(typeof(ContainerServiceNodePoolRollingEventDataConverter))] - public partial class ContainerServiceNodePoolRollingEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceNodePoolRollingEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceNodePoolRollingEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,23 +35,22 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("nodePoolName"u8); writer.WriteStringValue(NodePoolName); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,49 +59,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerServiceNodePoolRollingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceNodePoolRollingEventData(document.RootElement, options); } - internal static ContainerServiceNodePoolRollingEventData DeserializeContainerServiceNodePoolRollingEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceNodePoolRollingEventData DeserializeContainerServiceNodePoolRollingEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string nodePoolName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("nodePoolName"u8)) + if (prop.NameEquals("nodePoolName"u8)) { - nodePoolName = property.Value.GetString(); + nodePoolName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceNodePoolRollingEventData(nodePoolName, serializedAdditionalRawData); + return new ContainerServiceNodePoolRollingEventData(nodePoolName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +117,20 @@ BinaryData IPersistableModel.Write(Mod } } - ContainerServiceNodePoolRollingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceNodePoolRollingEventData(document.RootElement, options); } default: @@ -123,35 +138,28 @@ ContainerServiceNodePoolRollingEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ContainerServiceNodePoolRollingEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceNodePoolRollingEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceNodePoolRollingEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceNodePoolRollingEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceNodePoolRollingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNodePoolRollingEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceNodePoolRollingEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.cs index 65ffdb4776f8..b98b27f408c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingEventData.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of common properties of node pool rolling events. public partial class ContainerServiceNodePoolRollingEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// is null. internal ContainerServiceNodePoolRollingEventData(string nodePoolName) { - Argument.AssertNotNull(nodePoolName, nameof(nodePoolName)); - NodePoolName = nodePoolName; } /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNodePoolRollingEventData(string nodePoolName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ContainerServiceNodePoolRollingEventData(string nodePoolName, IDictionary additionalBinaryDataProperties) { NodePoolName = nodePoolName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceNodePoolRollingEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the node pool in the ManagedCluster resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.Serialization.cs index 7102bb5608c2..c6df9b52a656 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingFailed event. [JsonConverter(typeof(ContainerServiceNodePoolRollingFailedEventDataConverter))] - public partial class ContainerServiceNodePoolRollingFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceNodePoolRollingFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceNodePoolRollingFailedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8JsonWr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingFailedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerServiceNodePoolRollingFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerServiceNodePoolRollingFailedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceNodePoolRollingFailedEventData(document.RootElement, options); } - internal static ContainerServiceNodePoolRollingFailedEventData DeserializeContainerServiceNodePoolRollingFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceNodePoolRollingFailedEventData DeserializeContainerServiceNodePoolRollingFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string nodePoolName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("nodePoolName"u8)) + if (prop.NameEquals("nodePoolName"u8)) { - nodePoolName = property.Value.GetString(); + nodePoolName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceNodePoolRollingFailedEventData(nodePoolName, serializedAdditionalRawData); + return new ContainerServiceNodePoolRollingFailedEventData(nodePoolName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel.Wri } } - ContainerServiceNodePoolRollingFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerServiceNodePoolRollingFailedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceNodePoolRollingFailedEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ ContainerServiceNodePoolRollingFailedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerServiceNodePoolRollingFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceNodePoolRollingFailedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceNodePoolRollingFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceNodePoolRollingFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceNodePoolRollingFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNodePoolRollingFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceNodePoolRollingFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.cs index e2889e098f99..c02b89d3f6af 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingFailedEventData.cs @@ -15,21 +15,14 @@ public partial class ContainerServiceNodePoolRollingFailedEventData : ContainerS { /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// is null. internal ContainerServiceNodePoolRollingFailedEventData(string nodePoolName) : base(nodePoolName) { - Argument.AssertNotNull(nodePoolName, nameof(nodePoolName)); } /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNodePoolRollingFailedEventData(string nodePoolName, IDictionary serializedAdditionalRawData) : base(nodePoolName, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceNodePoolRollingFailedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerServiceNodePoolRollingFailedEventData(string nodePoolName, IDictionary additionalBinaryDataProperties) : base(nodePoolName, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.Serialization.cs index ae29070a4ca8..451bef1a7aca 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingStarted event. [JsonConverter(typeof(ContainerServiceNodePoolRollingStartedEventDataConverter))] - public partial class ContainerServiceNodePoolRollingStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceNodePoolRollingStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceNodePoolRollingStartedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8JsonW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingStartedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerServiceNodePoolRollingStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerServiceNodePoolRollingStartedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceNodePoolRollingStartedEventData(document.RootElement, options); } - internal static ContainerServiceNodePoolRollingStartedEventData DeserializeContainerServiceNodePoolRollingStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceNodePoolRollingStartedEventData DeserializeContainerServiceNodePoolRollingStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string nodePoolName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("nodePoolName"u8)) + if (prop.NameEquals("nodePoolName"u8)) { - nodePoolName = property.Value.GetString(); + nodePoolName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceNodePoolRollingStartedEventData(nodePoolName, serializedAdditionalRawData); + return new ContainerServiceNodePoolRollingStartedEventData(nodePoolName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel.Wr } } - ContainerServiceNodePoolRollingStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerServiceNodePoolRollingStartedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceNodePoolRollingStartedEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ ContainerServiceNodePoolRollingStartedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerServiceNodePoolRollingStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceNodePoolRollingStartedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceNodePoolRollingStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceNodePoolRollingStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceNodePoolRollingStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNodePoolRollingStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceNodePoolRollingStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.cs index 89edc1138e28..bc790b7df48c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingStartedEventData.cs @@ -15,21 +15,14 @@ public partial class ContainerServiceNodePoolRollingStartedEventData : Container { /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// is null. internal ContainerServiceNodePoolRollingStartedEventData(string nodePoolName) : base(nodePoolName) { - Argument.AssertNotNull(nodePoolName, nameof(nodePoolName)); } /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNodePoolRollingStartedEventData(string nodePoolName, IDictionary serializedAdditionalRawData) : base(nodePoolName, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceNodePoolRollingStartedEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerServiceNodePoolRollingStartedEventData(string nodePoolName, IDictionary additionalBinaryDataProperties) : base(nodePoolName, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.Serialization.cs index 3539a89e7001..39d69ba078c8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingSucceeded event. [JsonConverter(typeof(ContainerServiceNodePoolRollingSucceededEventDataConverter))] - public partial class ContainerServiceNodePoolRollingSucceededEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContainerServiceNodePoolRollingSucceededEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ContainerServiceNodePoolRollingSucceededEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,58 +35,63 @@ void IJsonModel.Write(Utf8Jso /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingSucceededEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ContainerServiceNodePoolRollingSucceededEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingSucceededEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ContainerServiceNodePoolRollingSucceededEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContainerServiceNodePoolRollingSucceededEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContainerServiceNodePoolRollingSucceededEventData(document.RootElement, options); } - internal static ContainerServiceNodePoolRollingSucceededEventData DeserializeContainerServiceNodePoolRollingSucceededEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ContainerServiceNodePoolRollingSucceededEventData DeserializeContainerServiceNodePoolRollingSucceededEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string nodePoolName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("nodePoolName"u8)) + if (prop.NameEquals("nodePoolName"u8)) { - nodePoolName = property.Value.GetString(); + nodePoolName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceNodePoolRollingSucceededEventData(nodePoolName, serializedAdditionalRawData); + return new ContainerServiceNodePoolRollingSucceededEventData(nodePoolName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -91,15 +101,20 @@ BinaryData IPersistableModel. } } - ContainerServiceNodePoolRollingSucceededEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ContainerServiceNodePoolRollingSucceededEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ContainerServiceNodePoolRollingSucceededEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeContainerServiceNodePoolRollingSucceededEventData(document.RootElement, options); } default: @@ -107,35 +122,28 @@ ContainerServiceNodePoolRollingSucceededEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ContainerServiceNodePoolRollingSucceededEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeContainerServiceNodePoolRollingSucceededEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ContainerServiceNodePoolRollingSucceededEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ContainerServiceNodePoolRollingSucceededEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ContainerServiceNodePoolRollingSucceededEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceNodePoolRollingSucceededEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceNodePoolRollingSucceededEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.cs index 6209fe995bdb..313a00b1314a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerServiceNodePoolRollingSucceededEventData.cs @@ -15,21 +15,14 @@ public partial class ContainerServiceNodePoolRollingSucceededEventData : Contain { /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// is null. internal ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName) : base(nodePoolName) { - Argument.AssertNotNull(nodePoolName, nameof(nodePoolName)); } /// Initializes a new instance of . /// The name of the node pool in the ManagedCluster resource. - /// Keeps track of any properties unknown to the library. - internal ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName, IDictionary serializedAdditionalRawData) : base(nodePoolName, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ContainerServiceNodePoolRollingSucceededEventData() + /// Keeps track of any properties unknown to the library. + internal ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName, IDictionary additionalBinaryDataProperties) : base(nodePoolName, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs index 18fe2f620e8c..7a8e7aab60e4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event. [JsonConverter(typeof(DataBoxCopyCompletedEventDataConverter))] - public partial class DataBoxCopyCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class DataBoxCopyCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DataBoxCopyCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataBoxCopyCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); if (Optional.IsDefined(StageName)) @@ -48,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("stageTime"u8); writer.WriteStringValue(StageTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -65,22 +69,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataBoxCopyCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DataBoxCopyCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DataBoxCopyCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataBoxCopyCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataBoxCopyCompletedEventData(document.RootElement, options); } - internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,46 +97,47 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve string serialNumber = default; DataBoxStageName? stageName = default; DateTimeOffset? stageTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("serialNumber"u8)) + if (prop.NameEquals("serialNumber"u8)) { - serialNumber = property.Value.GetString(); + serialNumber = prop.Value.GetString(); continue; } - if (property.NameEquals("stageName"u8)) + if (prop.NameEquals("stageName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stageName = new DataBoxStageName(property.Value.GetString()); + stageName = new DataBoxStageName(prop.Value.GetString()); continue; } - if (property.NameEquals("stageTime"u8)) + if (prop.NameEquals("stageTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stageTime = property.Value.GetDateTimeOffset("O"); + stageTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData); + return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -137,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - DataBoxCopyCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DataBoxCopyCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DataBoxCopyCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDataBoxCopyCompletedEventData(document.RootElement, options); } default: @@ -153,35 +168,28 @@ DataBoxCopyCompletedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DataBoxCopyCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataBoxCopyCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class DataBoxCopyCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, DataBoxCopyCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override DataBoxCopyCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeDataBoxCopyCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataBoxCopyCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs index c894a2bb1bc9..a8139746da38 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event. public partial class DataBoxCopyCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. - /// is null. internal DataBoxCopyCompletedEventData(string serialNumber) { - Argument.AssertNotNull(serialNumber, nameof(serialNumber)); - SerialNumber = serialNumber; } @@ -59,24 +27,21 @@ internal DataBoxCopyCompletedEventData(string serialNumber) /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. /// The time at which the stage happened. - /// Keeps track of any properties unknown to the library. - internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary additionalBinaryDataProperties) { SerialNumber = serialNumber; StageName = stageName; StageTime = stageTime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataBoxCopyCompletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } + /// Name of the current Stage. public DataBoxStageName? StageName { get; } + /// The time at which the stage happened. public DateTimeOffset? StageTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs index cd2168489f0d..7363053a1466 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyStarted event. [JsonConverter(typeof(DataBoxCopyStartedEventDataConverter))] - public partial class DataBoxCopyStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class DataBoxCopyStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DataBoxCopyStartedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataBoxCopyStartedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); if (Optional.IsDefined(StageName)) @@ -48,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("stageTime"u8); writer.WriteStringValue(StageTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -65,22 +69,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataBoxCopyStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DataBoxCopyStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DataBoxCopyStartedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataBoxCopyStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataBoxCopyStartedEventData(document.RootElement, options); } - internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,46 +97,47 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa string serialNumber = default; DataBoxStageName? stageName = default; DateTimeOffset? stageTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("serialNumber"u8)) + if (prop.NameEquals("serialNumber"u8)) { - serialNumber = property.Value.GetString(); + serialNumber = prop.Value.GetString(); continue; } - if (property.NameEquals("stageName"u8)) + if (prop.NameEquals("stageName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stageName = new DataBoxStageName(property.Value.GetString()); + stageName = new DataBoxStageName(prop.Value.GetString()); continue; } - if (property.NameEquals("stageTime"u8)) + if (prop.NameEquals("stageTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stageTime = property.Value.GetDateTimeOffset("O"); + stageTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData); + return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -137,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - DataBoxCopyStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DataBoxCopyStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DataBoxCopyStartedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDataBoxCopyStartedEventData(document.RootElement, options); } default: @@ -153,35 +168,28 @@ DataBoxCopyStartedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DataBoxCopyStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataBoxCopyStartedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class DataBoxCopyStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, DataBoxCopyStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override DataBoxCopyStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeDataBoxCopyStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataBoxCopyStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs index 13592291ba61..4a3db150c5fb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyStarted event. public partial class DataBoxCopyStartedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. - /// is null. internal DataBoxCopyStartedEventData(string serialNumber) { - Argument.AssertNotNull(serialNumber, nameof(serialNumber)); - SerialNumber = serialNumber; } @@ -59,24 +27,21 @@ internal DataBoxCopyStartedEventData(string serialNumber) /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. /// The time at which the stage happened. - /// Keeps track of any properties unknown to the library. - internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary additionalBinaryDataProperties) { SerialNumber = serialNumber; StageName = stageName; StageTime = stageTime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataBoxCopyStartedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } + /// Name of the current Stage. public DataBoxStageName? StageName { get; } + /// The time at which the stage happened. public DateTimeOffset? StageTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs index 525c027130b0..da4c44796112 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.OrderCompleted event. [JsonConverter(typeof(DataBoxOrderCompletedEventDataConverter))] - public partial class DataBoxOrderCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class DataBoxOrderCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DataBoxOrderCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataBoxOrderCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); if (Optional.IsDefined(StageName)) @@ -48,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("stageTime"u8); writer.WriteStringValue(StageTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -65,22 +69,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataBoxOrderCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DataBoxOrderCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DataBoxOrderCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataBoxOrderCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataBoxOrderCompletedEventData(document.RootElement, options); } - internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,46 +97,47 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE string serialNumber = default; DataBoxStageName? stageName = default; DateTimeOffset? stageTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("serialNumber"u8)) + if (prop.NameEquals("serialNumber"u8)) { - serialNumber = property.Value.GetString(); + serialNumber = prop.Value.GetString(); continue; } - if (property.NameEquals("stageName"u8)) + if (prop.NameEquals("stageName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stageName = new DataBoxStageName(property.Value.GetString()); + stageName = new DataBoxStageName(prop.Value.GetString()); continue; } - if (property.NameEquals("stageTime"u8)) + if (prop.NameEquals("stageTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - stageTime = property.Value.GetDateTimeOffset("O"); + stageTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData); + return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -137,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - DataBoxOrderCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DataBoxOrderCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DataBoxOrderCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDataBoxOrderCompletedEventData(document.RootElement, options); } default: @@ -153,35 +168,28 @@ DataBoxOrderCompletedEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DataBoxOrderCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataBoxOrderCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class DataBoxOrderCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, DataBoxOrderCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override DataBoxOrderCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeDataBoxOrderCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataBoxOrderCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs index a2887e55cc49..61c3978c722b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.OrderCompleted event. public partial class DataBoxOrderCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. - /// is null. internal DataBoxOrderCompletedEventData(string serialNumber) { - Argument.AssertNotNull(serialNumber, nameof(serialNumber)); - SerialNumber = serialNumber; } @@ -59,24 +27,21 @@ internal DataBoxOrderCompletedEventData(string serialNumber) /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. /// The time at which the stage happened. - /// Keeps track of any properties unknown to the library. - internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary additionalBinaryDataProperties) { SerialNumber = serialNumber; StageName = stageName; StageTime = stageTime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataBoxOrderCompletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } + /// Name of the current Stage. public DataBoxStageName? StageName { get; } + /// The time at which the stage happened. public DateTimeOffset? StageTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxStageName.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxStageName.cs index e96f0f477c10..8af6610f3d42 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxStageName.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxStageName.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct DataBoxStageName : IEquatable { private readonly string _value; + /// Copy has started. + private const string CopyStartedValue = "CopyStarted"; + /// Copy has completed. + private const string CopyCompletedValue = "CopyCompleted"; + /// Order has been completed. + private const string OrderCompletedValue = "OrderCompleted"; /// Initializes a new instance of . + /// The value. /// is null. public DataBoxStageName(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string CopyStartedValue = "CopyStarted"; - private const string CopyCompletedValue = "CopyCompleted"; - private const string OrderCompletedValue = "OrderCompleted"; + _value = value; + } /// Copy has started. public static DataBoxStageName CopyStarted { get; } = new DataBoxStageName(CopyStartedValue); + /// Copy has completed. public static DataBoxStageName CopyCompleted { get; } = new DataBoxStageName(CopyCompletedValue); + /// Order has been completed. public static DataBoxStageName OrderCompleted { get; } = new DataBoxStageName(OrderCompletedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(DataBoxStageName left, DataBoxStageName right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(DataBoxStageName left, DataBoxStageName right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator DataBoxStageName(string value) => new DataBoxStageName(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator DataBoxStageName?(string value) => value == null ? null : new DataBoxStageName(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is DataBoxStageName other && Equals(other); - /// + + /// public bool Equals(DataBoxStageName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.Serialization.cs index aa0bc6d30829..c8edf2419943 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceConnectionStateEventInfo : IUtf8JsonSerializable, IJsonModel + /// Information about the device connection state event. + public partial class DeviceConnectionStateEventInfo : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceConnectionStateEventInfo() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +33,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceConnectionStateEventInfo)} does not support writing '{format}' format."); } - writer.WritePropertyName("sequenceNumber"u8); writer.WriteStringValue(SequenceNumber); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceConnectionStateEventInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceConnectionStateEventInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceConnectionStateEventInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceConnectionStateEventInfo)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceConnectionStateEventInfo(document.RootElement, options); } - internal static DeviceConnectionStateEventInfo DeserializeDeviceConnectionStateEventInfo(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceConnectionStateEventInfo DeserializeDeviceConnectionStateEventInfo(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string sequenceNumber = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sequenceNumber"u8)) + if (prop.NameEquals("sequenceNumber"u8)) { - sequenceNumber = property.Value.GetString(); + sequenceNumber = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceConnectionStateEventInfo(sequenceNumber, serializedAdditionalRawData); + return new DeviceConnectionStateEventInfo(sequenceNumber, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - DeviceConnectionStateEventInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceConnectionStateEventInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceConnectionStateEventInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceConnectionStateEventInfo(document.RootElement, options); } default: @@ -121,22 +136,7 @@ DeviceConnectionStateEventInfo IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceConnectionStateEventInfo FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceConnectionStateEventInfo(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.cs index 94f66c88bade..782083ad0843 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Information about the device connection state event. public partial class DeviceConnectionStateEventInfo { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number. - /// is null. internal DeviceConnectionStateEventInfo(string sequenceNumber) { - Argument.AssertNotNull(sequenceNumber, nameof(sequenceNumber)); - SequenceNumber = sequenceNumber; } /// Initializes a new instance of . /// Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number. - /// Keeps track of any properties unknown to the library. - internal DeviceConnectionStateEventInfo(string sequenceNumber, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceConnectionStateEventInfo(string sequenceNumber, IDictionary additionalBinaryDataProperties) { SequenceNumber = sequenceNumber; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceConnectionStateEventInfo() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.Serialization.cs index 4ff6f7eea3f7..af3b5f172cbd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceConnectionStateEventProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected). + public partial class DeviceConnectionStateEventProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceConnectionStateEventProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceConnectionStateEventProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("deviceId"u8); writer.WriteStringValue(DeviceId); if (Optional.IsDefined(ModuleId)) @@ -45,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(HubName); writer.WritePropertyName("deviceConnectionStateEventInfo"u8); writer.WriteObjectValue(DeviceConnectionStateEventInfo, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -62,22 +66,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceConnectionStateEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceConnectionStateEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceConnectionStateEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceConnectionStateEventProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceConnectionStateEventProperties(document.RootElement, options); } - internal static DeviceConnectionStateEventProperties DeserializeDeviceConnectionStateEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceConnectionStateEventProperties DeserializeDeviceConnectionStateEventProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -86,43 +95,44 @@ internal static DeviceConnectionStateEventProperties DeserializeDeviceConnection string moduleId = default; string hubName = default; DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("moduleId"u8)) + if (prop.NameEquals("moduleId"u8)) { - moduleId = property.Value.GetString(); + moduleId = prop.Value.GetString(); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("deviceConnectionStateEventInfo"u8)) + if (prop.NameEquals("deviceConnectionStateEventInfo"u8)) { - deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEventInfo(property.Value, options); + deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEventInfo(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceConnectionStateEventProperties(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData); + return new DeviceConnectionStateEventProperties(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -132,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - DeviceConnectionStateEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceConnectionStateEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceConnectionStateEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceConnectionStateEventProperties(document.RootElement, options); } default: @@ -148,22 +163,7 @@ DeviceConnectionStateEventProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceConnectionStateEventProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceConnectionStateEventProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.cs index ec2dc0697b9f..621b306a9fb9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected). public partial class DeviceConnectionStateEventProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. - /// , or is null. internal DeviceConnectionStateEventProperties(string deviceId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(deviceConnectionStateEventInfo, nameof(deviceConnectionStateEventInfo)); - DeviceId = deviceId; HubName = hubName; DeviceConnectionStateEventInfo = deviceConnectionStateEventInfo; @@ -66,27 +32,25 @@ internal DeviceConnectionStateEventProperties(string deviceId, string hubName, D /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. - /// Keeps track of any properties unknown to the library. - internal DeviceConnectionStateEventProperties(string deviceId, string moduleId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceConnectionStateEventProperties(string deviceId, string moduleId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo, IDictionary additionalBinaryDataProperties) { DeviceId = deviceId; ModuleId = moduleId; HubName = hubName; DeviceConnectionStateEventInfo = deviceConnectionStateEventInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceConnectionStateEventProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. public string DeviceId { get; } + /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. public string ModuleId { get; } + /// Name of the IoT Hub where the device was created or deleted. public string HubName { get; } + /// Information about the device connection state event. public DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.Serialization.cs index f9b15d53f50c..ea890910e472 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceLifeCycleEventProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted). + public partial class DeviceLifeCycleEventProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceLifeCycleEventProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,27 +33,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceLifeCycleEventProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("deviceId"u8); writer.WriteStringValue(DeviceId); writer.WritePropertyName("hubName"u8); writer.WriteStringValue(HubName); writer.WritePropertyName("twin"u8); writer.WriteObjectValue(Twin, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,22 +61,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceLifeCycleEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceLifeCycleEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceLifeCycleEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceLifeCycleEventProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceLifeCycleEventProperties(document.RootElement, options); } - internal static DeviceLifeCycleEventProperties DeserializeDeviceLifeCycleEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceLifeCycleEventProperties DeserializeDeviceLifeCycleEventProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -80,38 +89,39 @@ internal static DeviceLifeCycleEventProperties DeserializeDeviceLifeCycleEventPr string deviceId = default; string hubName = default; DeviceTwinInfo twin = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("twin"u8)) + if (prop.NameEquals("twin"u8)) { - twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(property.Value, options); + twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceLifeCycleEventProperties(deviceId, hubName, twin, serializedAdditionalRawData); + return new DeviceLifeCycleEventProperties(deviceId, hubName, twin, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -121,15 +131,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - DeviceLifeCycleEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceLifeCycleEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceLifeCycleEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceLifeCycleEventProperties(document.RootElement, options); } default: @@ -137,22 +152,7 @@ DeviceLifeCycleEventProperties IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceLifeCycleEventProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceLifeCycleEventProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.cs index 3991030cc4f6..612a707f9c0f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted). public partial class DeviceLifeCycleEventProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. - /// , or is null. internal DeviceLifeCycleEventProperties(string deviceId, string hubName, DeviceTwinInfo twin) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(twin, nameof(twin)); - DeviceId = deviceId; HubName = hubName; Twin = twin; @@ -65,24 +31,21 @@ internal DeviceLifeCycleEventProperties(string deviceId, string hubName, DeviceT /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. - /// Keeps track of any properties unknown to the library. - internal DeviceLifeCycleEventProperties(string deviceId, string hubName, DeviceTwinInfo twin, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceLifeCycleEventProperties(string deviceId, string hubName, DeviceTwinInfo twin, IDictionary additionalBinaryDataProperties) { DeviceId = deviceId; HubName = hubName; Twin = twin; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceLifeCycleEventProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. public string DeviceId { get; } + /// Name of the IoT Hub where the device was created or deleted. public string HubName { get; } + /// Information about the device twin, which is the cloud representation of application device metadata. public DeviceTwinInfo Twin { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs index b3352a8ae1bd..5bb04b5c83a0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceTelemetryEventProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry). + public partial class DeviceTelemetryEventProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceTelemetryEventProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTelemetryEventProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("body"u8); writer.WriteObjectValue(Body, options); writer.WritePropertyName("properties"u8); @@ -41,6 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Properties) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -49,18 +58,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in SystemProperties) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,71 +83,91 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceTelemetryEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceTelemetryEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceTelemetryEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTelemetryEventProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceTelemetryEventProperties(document.RootElement, options); } - internal static DeviceTelemetryEventProperties DeserializeDeviceTelemetryEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceTelemetryEventProperties DeserializeDeviceTelemetryEventProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } object body = default; - IReadOnlyDictionary properties = default; - IReadOnlyDictionary systemProperties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary properties = default; + IDictionary systemProperties = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("body"u8)) + if (prop.NameEquals("body"u8)) { - body = property.Value.GetObject(); + body = prop.Value.GetObject(); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } properties = dictionary; continue; } - if (property.NameEquals("systemProperties"u8)) + if (prop.NameEquals("systemProperties"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } systemProperties = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceTelemetryEventProperties(body, properties, systemProperties, serializedAdditionalRawData); + return new DeviceTelemetryEventProperties(body, properties, systemProperties, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -143,15 +177,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - DeviceTelemetryEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceTelemetryEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceTelemetryEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceTelemetryEventProperties(document.RootElement, options); } default: @@ -159,22 +198,7 @@ DeviceTelemetryEventProperties IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceTelemetryEventProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceTelemetryEventProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs index 4bbac2e7a7ed..91d08bca56d0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry). public partial class DeviceTelemetryEventProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The content of the message from the device. /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. - /// , or is null. - internal DeviceTelemetryEventProperties(object body, IReadOnlyDictionary properties, IReadOnlyDictionary systemProperties) + internal DeviceTelemetryEventProperties(object body, IDictionary properties, IDictionary systemProperties) { - Argument.AssertNotNull(body, nameof(body)); - Argument.AssertNotNull(properties, nameof(properties)); - Argument.AssertNotNull(systemProperties, nameof(systemProperties)); - Body = body; Properties = properties; SystemProperties = systemProperties; @@ -65,22 +31,19 @@ internal DeviceTelemetryEventProperties(object body, IReadOnlyDictionary The content of the message from the device. /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. - /// Keeps track of any properties unknown to the library. - internal DeviceTelemetryEventProperties(object body, IReadOnlyDictionary properties, IReadOnlyDictionary systemProperties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceTelemetryEventProperties(object body, IDictionary properties, IDictionary systemProperties, IDictionary additionalBinaryDataProperties) { Body = body; Properties = properties; SystemProperties = systemProperties; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Initializes a new instance of for deserialization. - internal DeviceTelemetryEventProperties() - { - } /// Application properties are user-defined strings that can be added to the message. These fields are optional. - public IReadOnlyDictionary Properties { get; } + public IDictionary Properties { get; } + /// System properties help identify contents and source of the messages. - public IReadOnlyDictionary SystemProperties { get; } + public IDictionary SystemProperties { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.Serialization.cs index b9fdb0b174bd..e2185d2dd2ef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceTwinInfo : IUtf8JsonSerializable, IJsonModel + /// Information about the device twin, which is the cloud representation of application device metadata. + public partial class DeviceTwinInfo : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceTwinInfo() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinInfo)} does not support writing '{format}' format."); } - writer.WritePropertyName("authenticationType"u8); writer.WriteStringValue(AuthenticationType); if (Optional.IsDefined(CloudToDeviceMessageCount)) @@ -62,15 +66,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("x509Thumbprint"u8); writer.WriteObjectValue(X509Thumbprint, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -79,22 +83,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceTwinInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceTwinInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceTwinInfo JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinInfo)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceTwinInfo(document.RootElement, options); } - internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -110,79 +119,77 @@ internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element, Mo string statusUpdateTime = default; float? version = default; DeviceTwinInfoX509Thumbprint x509Thumbprint = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("authenticationType"u8)) + if (prop.NameEquals("authenticationType"u8)) { - authenticationType = property.Value.GetString(); + authenticationType = prop.Value.GetString(); continue; } - if (property.NameEquals("cloudToDeviceMessageCount"u8)) + if (prop.NameEquals("cloudToDeviceMessageCount"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - cloudToDeviceMessageCount = property.Value.GetSingle(); + cloudToDeviceMessageCount = prop.Value.GetSingle(); continue; } - if (property.NameEquals("connectionState"u8)) + if (prop.NameEquals("connectionState"u8)) { - connectionState = property.Value.GetString(); + connectionState = prop.Value.GetString(); continue; } - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("etag"u8)) { - etag = property.Value.GetString(); + etag = prop.Value.GetString(); continue; } - if (property.NameEquals("lastActivityTime"u8)) + if (prop.NameEquals("lastActivityTime"u8)) { - lastActivityTime = property.Value.GetString(); + lastActivityTime = prop.Value.GetString(); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { - properties = DeviceTwinInfoProperties.DeserializeDeviceTwinInfoProperties(property.Value, options); + properties = DeviceTwinInfoProperties.DeserializeDeviceTwinInfoProperties(prop.Value, options); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("statusUpdateTime"u8)) + if (prop.NameEquals("statusUpdateTime"u8)) { - statusUpdateTime = property.Value.GetString(); + statusUpdateTime = prop.Value.GetString(); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetSingle(); + version = prop.Value.GetSingle(); continue; } - if (property.NameEquals("x509Thumbprint"u8)) + if (prop.NameEquals("x509Thumbprint"u8)) { - x509Thumbprint = DeviceTwinInfoX509Thumbprint.DeserializeDeviceTwinInfoX509Thumbprint(property.Value, options); + x509Thumbprint = DeviceTwinInfoX509Thumbprint.DeserializeDeviceTwinInfoX509Thumbprint(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new DeviceTwinInfo( authenticationType, cloudToDeviceMessageCount, @@ -195,13 +202,16 @@ internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element, Mo statusUpdateTime, version, x509Thumbprint, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -211,15 +221,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opti } } - DeviceTwinInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceTwinInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceTwinInfo PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceTwinInfo(document.RootElement, options); } default: @@ -227,22 +242,7 @@ DeviceTwinInfo IPersistableModel.Create(BinaryData data, ModelRe } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceTwinInfo FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceTwinInfo(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.cs index 24cbbbc5ddd7..34b83aea5e47 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Information about the device twin, which is the cloud representation of application device metadata. public partial class DeviceTwinInfo { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority. @@ -55,19 +26,8 @@ public partial class DeviceTwinInfo /// Whether the device twin is enabled or disabled. /// The ISO8601 timestamp of the last device twin status update. /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. - /// , , , , , , , or is null. internal DeviceTwinInfo(string authenticationType, string connectionState, string deviceId, string etag, string lastActivityTime, DeviceTwinInfoProperties properties, string status, string statusUpdateTime, DeviceTwinInfoX509Thumbprint x509Thumbprint) { - Argument.AssertNotNull(authenticationType, nameof(authenticationType)); - Argument.AssertNotNull(connectionState, nameof(connectionState)); - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(etag, nameof(etag)); - Argument.AssertNotNull(lastActivityTime, nameof(lastActivityTime)); - Argument.AssertNotNull(properties, nameof(properties)); - Argument.AssertNotNull(status, nameof(status)); - Argument.AssertNotNull(statusUpdateTime, nameof(statusUpdateTime)); - Argument.AssertNotNull(x509Thumbprint, nameof(x509Thumbprint)); - AuthenticationType = authenticationType; ConnectionState = connectionState; DeviceId = deviceId; @@ -91,8 +51,8 @@ internal DeviceTwinInfo(string authenticationType, string connectionState, strin /// The ISO8601 timestamp of the last device twin status update. /// An integer that is incremented by one each time the device twin is updated. /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. - /// Keeps track of any properties unknown to the library. - internal DeviceTwinInfo(string authenticationType, float? cloudToDeviceMessageCount, string connectionState, string deviceId, string etag, string lastActivityTime, DeviceTwinInfoProperties properties, string status, string statusUpdateTime, float? version, DeviceTwinInfoX509Thumbprint x509Thumbprint, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceTwinInfo(string authenticationType, float? cloudToDeviceMessageCount, string connectionState, string deviceId, string etag, string lastActivityTime, DeviceTwinInfoProperties properties, string status, string statusUpdateTime, float? version, DeviceTwinInfoX509Thumbprint x509Thumbprint, IDictionary additionalBinaryDataProperties) { AuthenticationType = authenticationType; CloudToDeviceMessageCount = cloudToDeviceMessageCount; @@ -105,34 +65,39 @@ internal DeviceTwinInfo(string authenticationType, float? cloudToDeviceMessageCo StatusUpdateTime = statusUpdateTime; Version = version; X509Thumbprint = x509Thumbprint; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceTwinInfo() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority. public string AuthenticationType { get; } + /// Count of cloud to device messages sent to this device. public float? CloudToDeviceMessageCount { get; } + /// Whether the device is connected or disconnected. public string ConnectionState { get; } + /// The unique identifier of the device twin. public string DeviceId { get; } + /// A piece of information that describes the content of the device twin. Each etag is guaranteed to be unique per device twin. public string Etag { get; } + /// The ISO8601 timestamp of the last activity. public string LastActivityTime { get; } + /// Properties JSON element. public DeviceTwinInfoProperties Properties { get; } + /// Whether the device twin is enabled or disabled. public string Status { get; } + /// The ISO8601 timestamp of the last device twin status update. public string StatusUpdateTime { get; } + /// An integer that is incremented by one each time the device twin is updated. public float? Version { get; } + /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. public DeviceTwinInfoX509Thumbprint X509Thumbprint { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.Serialization.cs index 647b6ec2d363..10e828dbf0d6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceTwinInfoProperties : IUtf8JsonSerializable, IJsonModel + /// Properties JSON element. + public partial class DeviceTwinInfoProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceTwinInfoProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +33,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinInfoProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("desired"u8); writer.WriteObjectValue(Desired, options); writer.WritePropertyName("reported"u8); writer.WriteObjectValue(Reported, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +59,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceTwinInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceTwinInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceTwinInfoProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinInfoProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceTwinInfoProperties(document.RootElement, options); } - internal static DeviceTwinInfoProperties DeserializeDeviceTwinInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceTwinInfoProperties DeserializeDeviceTwinInfoProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DeviceTwinProperties desired = default; DeviceTwinProperties reported = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("desired"u8)) + if (prop.NameEquals("desired"u8)) { - desired = DeviceTwinProperties.DeserializeDeviceTwinProperties(property.Value, options); + desired = DeviceTwinProperties.DeserializeDeviceTwinProperties(prop.Value, options); continue; } - if (property.NameEquals("reported"u8)) + if (prop.NameEquals("reported"u8)) { - reported = DeviceTwinProperties.DeserializeDeviceTwinProperties(property.Value, options); + reported = DeviceTwinProperties.DeserializeDeviceTwinProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceTwinInfoProperties(desired, reported, serializedAdditionalRawData); + return new DeviceTwinInfoProperties(desired, reported, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +123,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - DeviceTwinInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceTwinInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceTwinInfoProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceTwinInfoProperties(document.RootElement, options); } default: @@ -129,22 +144,7 @@ DeviceTwinInfoProperties IPersistableModel.Create(Bina } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceTwinInfoProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceTwinInfoProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.cs index 1d970974ba3d..889cef701fd6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoProperties.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Properties JSON element. public partial class DeviceTwinInfoProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// A portion of the properties that can be written only by the application back-end, and read by the device. /// A portion of the properties that can be written only by the device, and read by the application back-end. - /// or is null. internal DeviceTwinInfoProperties(DeviceTwinProperties desired, DeviceTwinProperties reported) { - Argument.AssertNotNull(desired, nameof(desired)); - Argument.AssertNotNull(reported, nameof(reported)); - Desired = desired; Reported = reported; } @@ -61,21 +28,17 @@ internal DeviceTwinInfoProperties(DeviceTwinProperties desired, DeviceTwinProper /// Initializes a new instance of . /// A portion of the properties that can be written only by the application back-end, and read by the device. /// A portion of the properties that can be written only by the device, and read by the application back-end. - /// Keeps track of any properties unknown to the library. - internal DeviceTwinInfoProperties(DeviceTwinProperties desired, DeviceTwinProperties reported, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceTwinInfoProperties(DeviceTwinProperties desired, DeviceTwinProperties reported, IDictionary additionalBinaryDataProperties) { Desired = desired; Reported = reported; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceTwinInfoProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// A portion of the properties that can be written only by the application back-end, and read by the device. public DeviceTwinProperties Desired { get; } + /// A portion of the properties that can be written only by the device, and read by the application back-end. public DeviceTwinProperties Reported { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.Serialization.cs index acf933ab856c..6d172302d41b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceTwinInfoX509Thumbprint : IUtf8JsonSerializable, IJsonModel + /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. + public partial class DeviceTwinInfoX509Thumbprint : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceTwinInfoX509Thumbprint() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +33,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinInfoX509Thumbprint)} does not support writing '{format}' format."); } - writer.WritePropertyName("primaryThumbprint"u8); writer.WriteStringValue(PrimaryThumbprint); writer.WritePropertyName("secondaryThumbprint"u8); writer.WriteStringValue(SecondaryThumbprint); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +59,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceTwinInfoX509Thumbprint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceTwinInfoX509Thumbprint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceTwinInfoX509Thumbprint JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinInfoX509Thumbprint)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceTwinInfoX509Thumbprint(document.RootElement, options); } - internal static DeviceTwinInfoX509Thumbprint DeserializeDeviceTwinInfoX509Thumbprint(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceTwinInfoX509Thumbprint DeserializeDeviceTwinInfoX509Thumbprint(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string primaryThumbprint = default; string secondaryThumbprint = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("primaryThumbprint"u8)) + if (prop.NameEquals("primaryThumbprint"u8)) { - primaryThumbprint = property.Value.GetString(); + primaryThumbprint = prop.Value.GetString(); continue; } - if (property.NameEquals("secondaryThumbprint"u8)) + if (prop.NameEquals("secondaryThumbprint"u8)) { - secondaryThumbprint = property.Value.GetString(); + secondaryThumbprint = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceTwinInfoX509Thumbprint(primaryThumbprint, secondaryThumbprint, serializedAdditionalRawData); + return new DeviceTwinInfoX509Thumbprint(primaryThumbprint, secondaryThumbprint, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +123,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - DeviceTwinInfoX509Thumbprint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceTwinInfoX509Thumbprint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceTwinInfoX509Thumbprint PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceTwinInfoX509Thumbprint(document.RootElement, options); } default: @@ -129,22 +144,7 @@ DeviceTwinInfoX509Thumbprint IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceTwinInfoX509Thumbprint FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceTwinInfoX509Thumbprint(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.cs index 16f1d0d0ff9a..2e24ff1e6187 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. public partial class DeviceTwinInfoX509Thumbprint { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Primary thumbprint for the x509 certificate. /// Secondary thumbprint for the x509 certificate. - /// or is null. internal DeviceTwinInfoX509Thumbprint(string primaryThumbprint, string secondaryThumbprint) { - Argument.AssertNotNull(primaryThumbprint, nameof(primaryThumbprint)); - Argument.AssertNotNull(secondaryThumbprint, nameof(secondaryThumbprint)); - PrimaryThumbprint = primaryThumbprint; SecondaryThumbprint = secondaryThumbprint; } @@ -61,21 +28,17 @@ internal DeviceTwinInfoX509Thumbprint(string primaryThumbprint, string secondary /// Initializes a new instance of . /// Primary thumbprint for the x509 certificate. /// Secondary thumbprint for the x509 certificate. - /// Keeps track of any properties unknown to the library. - internal DeviceTwinInfoX509Thumbprint(string primaryThumbprint, string secondaryThumbprint, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceTwinInfoX509Thumbprint(string primaryThumbprint, string secondaryThumbprint, IDictionary additionalBinaryDataProperties) { PrimaryThumbprint = primaryThumbprint; SecondaryThumbprint = secondaryThumbprint; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceTwinInfoX509Thumbprint() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Primary thumbprint for the x509 certificate. public string PrimaryThumbprint { get; } + /// Secondary thumbprint for the x509 certificate. public string SecondaryThumbprint { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.Serialization.cs index ceb3648bd162..51e44653d4b2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceTwinMetadata : IUtf8JsonSerializable, IJsonModel + /// Metadata information for the properties JSON document. + public partial class DeviceTwinMetadata : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceTwinMetadata() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +33,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinMetadata)} does not support writing '{format}' format."); } - writer.WritePropertyName("lastUpdated"u8); writer.WriteStringValue(LastUpdated); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceTwinMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceTwinMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceTwinMetadata JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinMetadata)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceTwinMetadata(document.RootElement, options); } - internal static DeviceTwinMetadata DeserializeDeviceTwinMetadata(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceTwinMetadata DeserializeDeviceTwinMetadata(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string lastUpdated = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("lastUpdated"u8)) + if (prop.NameEquals("lastUpdated"u8)) { - lastUpdated = property.Value.GetString(); + lastUpdated = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceTwinMetadata(lastUpdated, serializedAdditionalRawData); + return new DeviceTwinMetadata(lastUpdated, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - DeviceTwinMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceTwinMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceTwinMetadata PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceTwinMetadata(document.RootElement, options); } default: @@ -121,22 +136,7 @@ DeviceTwinMetadata IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceTwinMetadata FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceTwinMetadata(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.cs index 80dcb2ffa49e..3352e53cc36c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Metadata information for the properties JSON document. public partial class DeviceTwinMetadata { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The ISO8601 timestamp of the last time the properties were updated. - /// is null. internal DeviceTwinMetadata(string lastUpdated) { - Argument.AssertNotNull(lastUpdated, nameof(lastUpdated)); - LastUpdated = lastUpdated; } /// Initializes a new instance of . /// The ISO8601 timestamp of the last time the properties were updated. - /// Keeps track of any properties unknown to the library. - internal DeviceTwinMetadata(string lastUpdated, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceTwinMetadata(string lastUpdated, IDictionary additionalBinaryDataProperties) { LastUpdated = lastUpdated; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceTwinMetadata() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ISO8601 timestamp of the last time the properties were updated. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.Serialization.cs index d735f7513f62..46f7872de3a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class DeviceTwinProperties : IUtf8JsonSerializable, IJsonModel + /// A portion of the properties that can be written only by the application back-end, and read by the device. + public partial class DeviceTwinProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DeviceTwinProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("metadata"u8); writer.WriteObjectValue(Metadata, options); if (Optional.IsDefined(Version)) @@ -41,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("version"u8); writer.WriteNumberValue(Version.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,59 +62,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeviceTwinProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DeviceTwinProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DeviceTwinProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DeviceTwinProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDeviceTwinProperties(document.RootElement, options); } - internal static DeviceTwinProperties DeserializeDeviceTwinProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DeviceTwinProperties DeserializeDeviceTwinProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DeviceTwinMetadata metadata = default; float? version = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("metadata"u8)) + if (prop.NameEquals("metadata"u8)) { - metadata = DeviceTwinMetadata.DeserializeDeviceTwinMetadata(property.Value, options); + metadata = DeviceTwinMetadata.DeserializeDeviceTwinMetadata(prop.Value, options); continue; } - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - version = property.Value.GetSingle(); + version = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DeviceTwinProperties(metadata, version, serializedAdditionalRawData); + return new DeviceTwinProperties(metadata, version, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -120,15 +130,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - DeviceTwinProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DeviceTwinProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DeviceTwinProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDeviceTwinProperties(document.RootElement, options); } default: @@ -136,22 +151,7 @@ DeviceTwinProperties IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DeviceTwinProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDeviceTwinProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.cs index c78e2695137a..304c76670423 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinProperties.cs @@ -13,66 +13,30 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// A portion of the properties that can be written only by the application back-end, and read by the device. public partial class DeviceTwinProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Metadata information for the properties JSON document. - /// is null. internal DeviceTwinProperties(DeviceTwinMetadata metadata) { - Argument.AssertNotNull(metadata, nameof(metadata)); - Metadata = metadata; } /// Initializes a new instance of . /// Metadata information for the properties JSON document. /// Version of device twin properties. - /// Keeps track of any properties unknown to the library. - internal DeviceTwinProperties(DeviceTwinMetadata metadata, float? version, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DeviceTwinProperties(DeviceTwinMetadata metadata, float? version, IDictionary additionalBinaryDataProperties) { Metadata = metadata; Version = version; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DeviceTwinProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Metadata information for the properties JSON document. public DeviceTwinMetadata Metadata { get; } + /// Version of device twin properties. public float? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.Serialization.cs index a7d627501057..f2e3e63caf6d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Edge.SolutionVersionPublished event. [JsonConverter(typeof(EdgeSolutionVersionPublishedEventDataConverter))] - public partial class EdgeSolutionVersionPublishedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EdgeSolutionVersionPublishedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EdgeSolutionVersionPublishedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EdgeSolutionVersionPublishedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("externalValidationId"u8); writer.WriteStringValue(ExternalValidationId); writer.WritePropertyName("targetId"u8); @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(ApiVersion); writer.WritePropertyName("callbackUrl"u8); writer.WriteStringValue(CallbackUrl.AbsoluteUri); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,22 +71,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EdgeSolutionVersionPublishedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EdgeSolutionVersionPublishedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual EdgeSolutionVersionPublishedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EdgeSolutionVersionPublishedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEdgeSolutionVersionPublishedEventData(document.RootElement, options); } - internal static EdgeSolutionVersionPublishedEventData DeserializeEdgeSolutionVersionPublishedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EdgeSolutionVersionPublishedEventData DeserializeEdgeSolutionVersionPublishedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,51 +103,49 @@ internal static EdgeSolutionVersionPublishedEventData DeserializeEdgeSolutionVer string solutionVersionId = default; string apiVersion = default; Uri callbackUrl = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("externalValidationId"u8)) + if (prop.NameEquals("externalValidationId"u8)) { - externalValidationId = property.Value.GetString(); + externalValidationId = prop.Value.GetString(); continue; } - if (property.NameEquals("targetId"u8)) + if (prop.NameEquals("targetId"u8)) { - targetId = property.Value.GetString(); + targetId = prop.Value.GetString(); continue; } - if (property.NameEquals("solutionTemplateId"u8)) + if (prop.NameEquals("solutionTemplateId"u8)) { - solutionTemplateId = property.Value.GetString(); + solutionTemplateId = prop.Value.GetString(); continue; } - if (property.NameEquals("solutionTemplateVersionId"u8)) + if (prop.NameEquals("solutionTemplateVersionId"u8)) { - solutionTemplateVersionId = property.Value.GetString(); + solutionTemplateVersionId = prop.Value.GetString(); continue; } - if (property.NameEquals("solutionVersionId"u8)) + if (prop.NameEquals("solutionVersionId"u8)) { - solutionVersionId = property.Value.GetString(); + solutionVersionId = prop.Value.GetString(); continue; } - if (property.NameEquals("apiVersion"u8)) + if (prop.NameEquals("apiVersion"u8)) { - apiVersion = property.Value.GetString(); + apiVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("callbackUrl"u8)) + if (prop.NameEquals("callbackUrl"u8)) { - callbackUrl = new Uri(property.Value.GetString()); + callbackUrl = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new EdgeSolutionVersionPublishedEventData( externalValidationId, targetId, @@ -147,13 +154,16 @@ internal static EdgeSolutionVersionPublishedEventData DeserializeEdgeSolutionVer solutionVersionId, apiVersion, callbackUrl, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -163,15 +173,20 @@ BinaryData IPersistableModel.Write(ModelR } } - EdgeSolutionVersionPublishedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EdgeSolutionVersionPublishedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual EdgeSolutionVersionPublishedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEdgeSolutionVersionPublishedEventData(document.RootElement, options); } default: @@ -179,35 +194,28 @@ EdgeSolutionVersionPublishedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static EdgeSolutionVersionPublishedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEdgeSolutionVersionPublishedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EdgeSolutionVersionPublishedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EdgeSolutionVersionPublishedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EdgeSolutionVersionPublishedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEdgeSolutionVersionPublishedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEdgeSolutionVersionPublishedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.cs index 219c36f6fa89..380746574086 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EdgeSolutionVersionPublishedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Edge.SolutionVersionPublished event. public partial class EdgeSolutionVersionPublishedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// A GUID to uniquely track External Solution Validation. @@ -53,17 +24,8 @@ public partial class EdgeSolutionVersionPublishedEventData /// ARM ID of the Solution Version resource. /// API Version supported for the resources. /// Direct URL to callback for updating validation status. - /// , , , , , or is null. internal EdgeSolutionVersionPublishedEventData(string externalValidationId, string targetId, string solutionTemplateId, string solutionTemplateVersionId, string solutionVersionId, string apiVersion, Uri callbackUrl) { - Argument.AssertNotNull(externalValidationId, nameof(externalValidationId)); - Argument.AssertNotNull(targetId, nameof(targetId)); - Argument.AssertNotNull(solutionTemplateId, nameof(solutionTemplateId)); - Argument.AssertNotNull(solutionTemplateVersionId, nameof(solutionTemplateVersionId)); - Argument.AssertNotNull(solutionVersionId, nameof(solutionVersionId)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - Argument.AssertNotNull(callbackUrl, nameof(callbackUrl)); - ExternalValidationId = externalValidationId; TargetId = targetId; SolutionTemplateId = solutionTemplateId; @@ -81,8 +43,8 @@ internal EdgeSolutionVersionPublishedEventData(string externalValidationId, stri /// ARM ID of the Solution Version resource. /// API Version supported for the resources. /// Direct URL to callback for updating validation status. - /// Keeps track of any properties unknown to the library. - internal EdgeSolutionVersionPublishedEventData(string externalValidationId, string targetId, string solutionTemplateId, string solutionTemplateVersionId, string solutionVersionId, string apiVersion, Uri callbackUrl, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal EdgeSolutionVersionPublishedEventData(string externalValidationId, string targetId, string solutionTemplateId, string solutionTemplateVersionId, string solutionVersionId, string apiVersion, Uri callbackUrl, IDictionary additionalBinaryDataProperties) { ExternalValidationId = externalValidationId; TargetId = targetId; @@ -91,26 +53,27 @@ internal EdgeSolutionVersionPublishedEventData(string externalValidationId, stri SolutionVersionId = solutionVersionId; ApiVersion = apiVersion; CallbackUrl = callbackUrl; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal EdgeSolutionVersionPublishedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// A GUID to uniquely track External Solution Validation. public string ExternalValidationId { get; } + /// ARM ID of the Target resource. public string TargetId { get; } + /// ARM ID of the Solution Template resource. public string SolutionTemplateId { get; } + /// ARM ID of the Solution Template Version resource. public string SolutionTemplateVersionId { get; } + /// ARM ID of the Solution Version resource. public string SolutionVersionId { get; } + /// API Version supported for the resources. public string ApiVersion { get; } + /// Direct URL to callback for updating validation status. public Uri CallbackUrl { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs index 98d1de8e9b2d..ad89ab996eba 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs @@ -8,567 +8,568 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.Core; using Azure.Messaging.EventGrid.SystemEvents; namespace Azure.Messaging.EventGrid { - /// Model factory for models. + /// A factory class for creating instances of the models for mocking. public static partial class EventGridModelFactory { - /// Initializes a new instance of . + /// Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionAdded event. /// API definition title. /// API definition description. /// API definition specification. /// A new instance for mocking. - public static ApiCenterApiDefinitionAddedEventData ApiCenterApiDefinitionAddedEventData(string title = null, string description = null, ApiCenterApiSpecification specification = null) + public static ApiCenterApiDefinitionAddedEventData ApiCenterApiDefinitionAddedEventData(string title = default, string description = default, ApiCenterApiSpecification specification = default) { - return new ApiCenterApiDefinitionAddedEventData(title, description, specification, serializedAdditionalRawData: null); + return new ApiCenterApiDefinitionAddedEventData(title, description, specification, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// API specification details. /// Specification name. /// Specification version. /// A new instance for mocking. - public static ApiCenterApiSpecification ApiCenterApiSpecification(string name = null, string version = null) + public static ApiCenterApiSpecification ApiCenterApiSpecification(string name = default, string version = default) { - return new ApiCenterApiSpecification(name, version, serializedAdditionalRawData: null); + return new ApiCenterApiSpecification(name, version, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionUpdated event. /// API definition title. /// API definition description. /// API definition specification. /// A new instance for mocking. - public static ApiCenterApiDefinitionUpdatedEventData ApiCenterApiDefinitionUpdatedEventData(string title = null, string description = null, ApiCenterApiSpecification specification = null) + public static ApiCenterApiDefinitionUpdatedEventData ApiCenterApiDefinitionUpdatedEventData(string title = default, string description = default, ApiCenterApiSpecification specification = default) { - return new ApiCenterApiDefinitionUpdatedEventData(title, description, specification, serializedAdditionalRawData: null); + return new ApiCenterApiDefinitionUpdatedEventData(title, description, specification, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementUserCreatedEventData ApiManagementUserCreatedEventData(string resourceUri = null) + public static ApiManagementUserCreatedEventData ApiManagementUserCreatedEventData(string resourceUri = default) { - return new ApiManagementUserCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementUserCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementUserUpdatedEventData ApiManagementUserUpdatedEventData(string resourceUri = null) + public static ApiManagementUserUpdatedEventData ApiManagementUserUpdatedEventData(string resourceUri = default) { - return new ApiManagementUserUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementUserUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementUserDeletedEventData ApiManagementUserDeletedEventData(string resourceUri = null) + public static ApiManagementUserDeletedEventData ApiManagementUserDeletedEventData(string resourceUri = default) { - return new ApiManagementUserDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementUserDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementSubscriptionCreatedEventData ApiManagementSubscriptionCreatedEventData(string resourceUri = null) + public static ApiManagementSubscriptionCreatedEventData ApiManagementSubscriptionCreatedEventData(string resourceUri = default) { - return new ApiManagementSubscriptionCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementSubscriptionCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementSubscriptionUpdatedEventData ApiManagementSubscriptionUpdatedEventData(string resourceUri = null) + public static ApiManagementSubscriptionUpdatedEventData ApiManagementSubscriptionUpdatedEventData(string resourceUri = default) { - return new ApiManagementSubscriptionUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementSubscriptionUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementSubscriptionDeletedEventData ApiManagementSubscriptionDeletedEventData(string resourceUri = null) + public static ApiManagementSubscriptionDeletedEventData ApiManagementSubscriptionDeletedEventData(string resourceUri = default) { - return new ApiManagementSubscriptionDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementSubscriptionDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementProductCreatedEventData ApiManagementProductCreatedEventData(string resourceUri = null) + public static ApiManagementProductCreatedEventData ApiManagementProductCreatedEventData(string resourceUri = default) { - return new ApiManagementProductCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementProductCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementProductUpdatedEventData ApiManagementProductUpdatedEventData(string resourceUri = null) + public static ApiManagementProductUpdatedEventData ApiManagementProductUpdatedEventData(string resourceUri = default) { - return new ApiManagementProductUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementProductUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementProductDeletedEventData ApiManagementProductDeletedEventData(string resourceUri = null) + public static ApiManagementProductDeletedEventData ApiManagementProductDeletedEventData(string resourceUri = default) { - return new ApiManagementProductDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementProductDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementApiCreatedEventData ApiManagementApiCreatedEventData(string resourceUri = null) + public static ApiManagementApiCreatedEventData ApiManagementApiCreatedEventData(string resourceUri = default) { - return new ApiManagementApiCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementApiCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementApiUpdatedEventData ApiManagementApiUpdatedEventData(string resourceUri = null) + public static ApiManagementApiUpdatedEventData ApiManagementApiUpdatedEventData(string resourceUri = default) { - return new ApiManagementApiUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementApiUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementApiDeletedEventData ApiManagementApiDeletedEventData(string resourceUri = null) + public static ApiManagementApiDeletedEventData ApiManagementApiDeletedEventData(string resourceUri = default) { - return new ApiManagementApiDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementApiDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementApiReleaseCreatedEventData ApiManagementApiReleaseCreatedEventData(string resourceUri = null) + public static ApiManagementApiReleaseCreatedEventData ApiManagementApiReleaseCreatedEventData(string resourceUri = default) { - return new ApiManagementApiReleaseCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementApiReleaseCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementApiReleaseUpdatedEventData ApiManagementApiReleaseUpdatedEventData(string resourceUri = null) + public static ApiManagementApiReleaseUpdatedEventData ApiManagementApiReleaseUpdatedEventData(string resourceUri = default) { - return new ApiManagementApiReleaseUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementApiReleaseUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/<ResourceType>/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementApiReleaseDeletedEventData ApiManagementApiReleaseDeletedEventData(string resourceUri = null) + public static ApiManagementApiReleaseDeletedEventData ApiManagementApiReleaseDeletedEventData(string resourceUri = default) { - return new ApiManagementApiReleaseDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementApiReleaseDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayCreatedEventData ApiManagementGatewayCreatedEventData(string resourceUri = null) + public static ApiManagementGatewayCreatedEventData ApiManagementGatewayCreatedEventData(string resourceUri = default) { - return new ApiManagementGatewayCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayUpdatedEventData ApiManagementGatewayUpdatedEventData(string resourceUri = null) + public static ApiManagementGatewayUpdatedEventData ApiManagementGatewayUpdatedEventData(string resourceUri = default) { - return new ApiManagementGatewayUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayDeletedEventData ApiManagementGatewayDeletedEventData(string resourceUri = null) + public static ApiManagementGatewayDeletedEventData ApiManagementGatewayDeletedEventData(string resourceUri = default) { - return new ApiManagementGatewayDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayHostnameConfigurationCreatedEventData ApiManagementGatewayHostnameConfigurationCreatedEventData(string resourceUri = null) + public static ApiManagementGatewayHostnameConfigurationCreatedEventData ApiManagementGatewayHostnameConfigurationCreatedEventData(string resourceUri = default) { - return new ApiManagementGatewayHostnameConfigurationCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayHostnameConfigurationCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayHostnameConfigurationUpdatedEventData ApiManagementGatewayHostnameConfigurationUpdatedEventData(string resourceUri = null) + public static ApiManagementGatewayHostnameConfigurationUpdatedEventData ApiManagementGatewayHostnameConfigurationUpdatedEventData(string resourceUri = default) { - return new ApiManagementGatewayHostnameConfigurationUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayHostnameConfigurationUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/hostnameConfigurations/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayHostnameConfigurationDeletedEventData ApiManagementGatewayHostnameConfigurationDeletedEventData(string resourceUri = null) + public static ApiManagementGatewayHostnameConfigurationDeletedEventData ApiManagementGatewayHostnameConfigurationDeletedEventData(string resourceUri = default) { - return new ApiManagementGatewayHostnameConfigurationDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayHostnameConfigurationDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityCreated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayCertificateAuthorityCreatedEventData ApiManagementGatewayCertificateAuthorityCreatedEventData(string resourceUri = null) + public static ApiManagementGatewayCertificateAuthorityCreatedEventData ApiManagementGatewayCertificateAuthorityCreatedEventData(string resourceUri = default) { - return new ApiManagementGatewayCertificateAuthorityCreatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayCertificateAuthorityCreatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityUpdated event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayCertificateAuthorityUpdatedEventData ApiManagementGatewayCertificateAuthorityUpdatedEventData(string resourceUri = null) + public static ApiManagementGatewayCertificateAuthorityUpdatedEventData ApiManagementGatewayCertificateAuthorityUpdatedEventData(string resourceUri = default) { - return new ApiManagementGatewayCertificateAuthorityUpdatedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayCertificateAuthorityUpdatedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityDeleted event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/certificateAuthorities/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayCertificateAuthorityDeletedEventData ApiManagementGatewayCertificateAuthorityDeletedEventData(string resourceUri = null) + public static ApiManagementGatewayCertificateAuthorityDeletedEventData ApiManagementGatewayCertificateAuthorityDeletedEventData(string resourceUri = default) { - return new ApiManagementGatewayCertificateAuthorityDeletedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayCertificateAuthorityDeletedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIAdded event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/apis/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayApiAddedEventData ApiManagementGatewayApiAddedEventData(string resourceUri = null) + public static ApiManagementGatewayApiAddedEventData ApiManagementGatewayApiAddedEventData(string resourceUri = default) { - return new ApiManagementGatewayApiAddedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayApiAddedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIRemoved event. /// The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateways/<GatewayName>/apis/<ResourceName>`. /// A new instance for mocking. - public static ApiManagementGatewayApiRemovedEventData ApiManagementGatewayApiRemovedEventData(string resourceUri = null) + public static ApiManagementGatewayApiRemovedEventData ApiManagementGatewayApiRemovedEventData(string resourceUri = default) { - return new ApiManagementGatewayApiRemovedEventData(resourceUri, serializedAdditionalRawData: null); + return new ApiManagementGatewayApiRemovedEventData(resourceUri, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.CircuitBreaker.Opened event. /// Name of the backend for which the circuit has opened. /// Information related to the circuit breaker configured on the backend. /// A new instance for mocking. - public static ApiManagementCircuitBreakerOpenedEventData ApiManagementCircuitBreakerOpenedEventData(string backendName = null, ApiManagementCircuitBreakerProperties circuitBreaker = null) + public static ApiManagementCircuitBreakerOpenedEventData ApiManagementCircuitBreakerOpenedEventData(string backendName = default, ApiManagementCircuitBreakerProperties circuitBreaker = default) { - return new ApiManagementCircuitBreakerOpenedEventData(backendName, circuitBreaker, serializedAdditionalRawData: null); + return new ApiManagementCircuitBreakerOpenedEventData(backendName, circuitBreaker, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information related to the circuit breaker configured on the backend. /// Overview of all configured rules and respective details. /// A new instance for mocking. - public static ApiManagementCircuitBreakerProperties ApiManagementCircuitBreakerProperties(IReadOnlyDictionary rules = null) + public static ApiManagementCircuitBreakerProperties ApiManagementCircuitBreakerProperties(IReadOnlyDictionary rules = default) { - rules ??= new Dictionary(); + rules ??= new ChangeTrackingDictionary(); - return new ApiManagementCircuitBreakerProperties(rules, serializedAdditionalRawData: null); + return new ApiManagementCircuitBreakerProperties(rules, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.CircuitBreaker.Closed event. /// Name of the backend for which the circuit has closed. /// Information related to the circuit breaker configured on the backend. /// A new instance for mocking. - public static ApiManagementCircuitBreakerClosedEventData ApiManagementCircuitBreakerClosedEventData(string backendName = null, ApiManagementCircuitBreakerProperties circuitBreaker = null) + public static ApiManagementCircuitBreakerClosedEventData ApiManagementCircuitBreakerClosedEventData(string backendName = default, ApiManagementCircuitBreakerProperties circuitBreaker = default) { - return new ApiManagementCircuitBreakerClosedEventData(backendName, circuitBreaker, serializedAdditionalRawData: null); + return new ApiManagementCircuitBreakerClosedEventData(backendName, circuitBreaker, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayTokenNearExpiry event. /// Information related to a given self-hosted gateway deployment. /// Information related to a an expired gateway token for a self-hosted gateway deployment. /// A new instance for mocking. - public static ApiManagementGatewayTokenNearExpiryEventData ApiManagementGatewayTokenNearExpiryEventData(ApiManagementGatewayProperties gateway = null, ApiManagementGatewayTokenNearExpiryProperties token = null) + public static ApiManagementGatewayTokenNearExpiryEventData ApiManagementGatewayTokenNearExpiryEventData(ApiManagementGatewayProperties gateway = default, ApiManagementGatewayTokenNearExpiryProperties token = default) { - return new ApiManagementGatewayTokenNearExpiryEventData(gateway, token, serializedAdditionalRawData: null); + return new ApiManagementGatewayTokenNearExpiryEventData(gateway, token, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information related to a given self-hosted gateway deployment. /// Id of Gateway that is used to deploy the gateway to get the configuration for. This is the ARM resource ID referenced in the Azure API Management instance. Uses the format, `/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/Microsoft.ApiManagement/service/<ServiceName>/gateway/<GatewayName>`. /// Unique instance ID of the deployed gateway. /// A new instance for mocking. - public static ApiManagementGatewayProperties ApiManagementGatewayProperties(string gatewayId = null, string instanceId = null) + public static ApiManagementGatewayProperties ApiManagementGatewayProperties(string gatewayId = default, string instanceId = default) { - return new ApiManagementGatewayProperties(gatewayId, instanceId, serializedAdditionalRawData: null); + return new ApiManagementGatewayProperties(gatewayId, instanceId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information related to a gateway token that is near expiry for a self-hosted gateway deployment. /// Timestamp when the gateway token will expire. /// A new instance for mocking. - public static ApiManagementGatewayTokenNearExpiryProperties ApiManagementGatewayTokenNearExpiryProperties(DateTimeOffset? expiresOn = null) + public static ApiManagementGatewayTokenNearExpiryProperties ApiManagementGatewayTokenNearExpiryProperties(DateTimeOffset? expiresOn = default) { - return new ApiManagementGatewayTokenNearExpiryProperties(expiresOn, serializedAdditionalRawData: null); + return new ApiManagementGatewayTokenNearExpiryProperties(expiresOn, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayTokenExpired event. /// Information related to a given self-hosted gateway deployment. /// Information related to a an expired gateway token for a self-hosted gateway deployment. /// A new instance for mocking. - public static ApiManagementGatewayTokenExpiredEventData ApiManagementGatewayTokenExpiredEventData(ApiManagementGatewayProperties gateway = null, ApiManagementExpiredGatewayTokenProperties token = null) + public static ApiManagementGatewayTokenExpiredEventData ApiManagementGatewayTokenExpiredEventData(ApiManagementGatewayProperties gateway = default, ApiManagementExpiredGatewayTokenProperties token = default) { - return new ApiManagementGatewayTokenExpiredEventData(gateway, token, serializedAdditionalRawData: null); + return new ApiManagementGatewayTokenExpiredEventData(gateway, token, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information related to a gateway token that has expired for a self-hosted gateway deployment. /// Timestamp when the gateway token has expired. /// A new instance for mocking. - public static ApiManagementExpiredGatewayTokenProperties ApiManagementExpiredGatewayTokenProperties(DateTimeOffset? expiresOn = null) + public static ApiManagementExpiredGatewayTokenProperties ApiManagementExpiredGatewayTokenProperties(DateTimeOffset? expiresOn = default) { - return new ApiManagementExpiredGatewayTokenProperties(expiresOn, serializedAdditionalRawData: null); + return new ApiManagementExpiredGatewayTokenProperties(expiresOn, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event. /// The key used to identify the key-value that was modified. /// The label, if any, used to identify the key-value that was modified. /// The etag representing the new state of the key-value. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationKeyValueModifiedEventData AppConfigurationKeyValueModifiedEventData(string key = null, string label = null, string etag = null, string syncToken = null) + public static AppConfigurationKeyValueModifiedEventData AppConfigurationKeyValueModifiedEventData(string key = default, string label = default, string etag = default, string syncToken = default) { - return new AppConfigurationKeyValueModifiedEventData(key, label, etag, syncToken, serializedAdditionalRawData: null); + return new AppConfigurationKeyValueModifiedEventData(key, label, etag, syncToken, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event. /// The key used to identify the key-value that was deleted. /// The label, if any, used to identify the key-value that was deleted. /// The etag representing the key-value that was deleted. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueDeletedEventData(string key = null, string label = null, string etag = null, string syncToken = null) + public static AppConfigurationKeyValueDeletedEventData AppConfigurationKeyValueDeletedEventData(string key = default, string label = default, string etag = default, string syncToken = default) { - return new AppConfigurationKeyValueDeletedEventData(key, label, etag, syncToken, serializedAdditionalRawData: null); + return new AppConfigurationKeyValueDeletedEventData(key, label, etag, syncToken, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of snapshot events. /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string eTag = null, string syncToken = null) + public static AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = default, string eTag = default, string syncToken = default) { - return new AppConfigurationSnapshotEventData(name, eTag, syncToken, serializedAdditionalRawData: null); + return new AppConfigurationSnapshotEventData(name, eTag, syncToken, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotCreated event. /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string eTag = null, string syncToken = null) + public static AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = default, string eTag = default, string syncToken = default) { - return new AppConfigurationSnapshotCreatedEventData(name, eTag, syncToken, serializedAdditionalRawData: null); + return new AppConfigurationSnapshotCreatedEventData(name, eTag, syncToken, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.SnapshotModified event. /// The name of the snapshot. /// The etag representing the new state of the snapshot. /// The sync token representing the server state after the event. /// A new instance for mocking. - public static AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string eTag = null, string syncToken = null) + public static AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = default, string eTag = default, string syncToken = default) { - return new AppConfigurationSnapshotModifiedEventData(name, eTag, syncToken, serializedAdditionalRawData: null); + return new AppConfigurationSnapshotModifiedEventData(name, eTag, syncToken, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/privateClouds events. /// Id of the operation that caused this event. /// A new instance for mocking. - public static AvsPrivateCloudEventData AvsPrivateCloudEventData(string operationId = null) + public static AvsPrivateCloudEventData AvsPrivateCloudEventData(string operationId = default) { - return new AvsPrivateCloudEventData(operationId, serializedAdditionalRawData: null); + return new AvsPrivateCloudEventData(operationId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.PrivateCloudUpdating event. /// Id of the operation that caused this event. /// A new instance for mocking. - public static AvsPrivateCloudUpdatingEventData AvsPrivateCloudUpdatingEventData(string operationId = null) + public static AvsPrivateCloudUpdatingEventData AvsPrivateCloudUpdatingEventData(string operationId = default) { - return new AvsPrivateCloudUpdatingEventData(operationId, serializedAdditionalRawData: null); + return new AvsPrivateCloudUpdatingEventData(operationId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.PrivateCloudUpdated event. /// Id of the operation that caused this event. /// A new instance for mocking. - public static AvsPrivateCloudUpdatedEventData AvsPrivateCloudUpdatedEventData(string operationId = null) + public static AvsPrivateCloudUpdatedEventData AvsPrivateCloudUpdatedEventData(string operationId = default) { - return new AvsPrivateCloudUpdatedEventData(operationId, serializedAdditionalRawData: null); + return new AvsPrivateCloudUpdatedEventData(operationId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.PrivateCloudFailed event. /// Id of the operation that caused this event. /// Failure reason of an event. /// A new instance for mocking. - public static AvsPrivateCloudFailedEventData AvsPrivateCloudFailedEventData(string operationId = null, string failureMessage = null) + public static AvsPrivateCloudFailedEventData AvsPrivateCloudFailedEventData(string operationId = default, string failureMessage = default) { - return new AvsPrivateCloudFailedEventData(operationId, serializedAdditionalRawData: null, failureMessage); + return new AvsPrivateCloudFailedEventData(operationId, additionalBinaryDataProperties: null, failureMessage); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/clusters events. /// Id of the operation that caused this event. /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. /// A new instance for mocking. - public static AvsClusterEventData AvsClusterEventData(string operationId = null, IEnumerable addedHostNames = null, IEnumerable removedHostNames = null, IEnumerable inMaintenanceHostNames = null) + public static AvsClusterEventData AvsClusterEventData(string operationId = default, IEnumerable addedHostNames = default, IEnumerable removedHostNames = default, IEnumerable inMaintenanceHostNames = default) { - addedHostNames ??= new List(); - removedHostNames ??= new List(); - inMaintenanceHostNames ??= new List(); + addedHostNames ??= new ChangeTrackingList(); + removedHostNames ??= new ChangeTrackingList(); + inMaintenanceHostNames ??= new ChangeTrackingList(); - return new AvsClusterEventData(operationId, addedHostNames?.ToList(), removedHostNames?.ToList(), inMaintenanceHostNames?.ToList(), serializedAdditionalRawData: null); + return new AvsClusterEventData(operationId, addedHostNames.ToList(), removedHostNames.ToList(), inMaintenanceHostNames.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterCreated event. /// Id of the operation that caused this event. /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. /// A new instance for mocking. - public static AvsClusterCreatedEventData AvsClusterCreatedEventData(string operationId = null, IEnumerable addedHostNames = null, IEnumerable removedHostNames = null, IEnumerable inMaintenanceHostNames = null) + public static AvsClusterCreatedEventData AvsClusterCreatedEventData(string operationId = default, IEnumerable addedHostNames = default, IEnumerable removedHostNames = default, IEnumerable inMaintenanceHostNames = default) { - addedHostNames ??= new List(); - removedHostNames ??= new List(); - inMaintenanceHostNames ??= new List(); + addedHostNames ??= new ChangeTrackingList(); + removedHostNames ??= new ChangeTrackingList(); + inMaintenanceHostNames ??= new ChangeTrackingList(); - return new AvsClusterCreatedEventData(operationId, addedHostNames?.ToList(), removedHostNames?.ToList(), inMaintenanceHostNames?.ToList(), serializedAdditionalRawData: null); + return new AvsClusterCreatedEventData(operationId, addedHostNames.ToList(), removedHostNames.ToList(), inMaintenanceHostNames.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterDeleted event. /// Id of the operation that caused this event. /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. /// A new instance for mocking. - public static AvsClusterDeletedEventData AvsClusterDeletedEventData(string operationId = null, IEnumerable addedHostNames = null, IEnumerable removedHostNames = null, IEnumerable inMaintenanceHostNames = null) + public static AvsClusterDeletedEventData AvsClusterDeletedEventData(string operationId = default, IEnumerable addedHostNames = default, IEnumerable removedHostNames = default, IEnumerable inMaintenanceHostNames = default) { - addedHostNames ??= new List(); - removedHostNames ??= new List(); - inMaintenanceHostNames ??= new List(); + addedHostNames ??= new ChangeTrackingList(); + removedHostNames ??= new ChangeTrackingList(); + inMaintenanceHostNames ??= new ChangeTrackingList(); - return new AvsClusterDeletedEventData(operationId, addedHostNames?.ToList(), removedHostNames?.ToList(), inMaintenanceHostNames?.ToList(), serializedAdditionalRawData: null); + return new AvsClusterDeletedEventData(operationId, addedHostNames.ToList(), removedHostNames.ToList(), inMaintenanceHostNames.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterUpdating event. /// Id of the operation that caused this event. /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. /// A new instance for mocking. - public static AvsClusterUpdatingEventData AvsClusterUpdatingEventData(string operationId = null, IEnumerable addedHostNames = null, IEnumerable removedHostNames = null, IEnumerable inMaintenanceHostNames = null) + public static AvsClusterUpdatingEventData AvsClusterUpdatingEventData(string operationId = default, IEnumerable addedHostNames = default, IEnumerable removedHostNames = default, IEnumerable inMaintenanceHostNames = default) { - addedHostNames ??= new List(); - removedHostNames ??= new List(); - inMaintenanceHostNames ??= new List(); + addedHostNames ??= new ChangeTrackingList(); + removedHostNames ??= new ChangeTrackingList(); + inMaintenanceHostNames ??= new ChangeTrackingList(); - return new AvsClusterUpdatingEventData(operationId, addedHostNames?.ToList(), removedHostNames?.ToList(), inMaintenanceHostNames?.ToList(), serializedAdditionalRawData: null); + return new AvsClusterUpdatingEventData(operationId, addedHostNames.ToList(), removedHostNames.ToList(), inMaintenanceHostNames.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterUpdated event. /// Id of the operation that caused this event. /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. /// A new instance for mocking. - public static AvsClusterUpdatedEventData AvsClusterUpdatedEventData(string operationId = null, IEnumerable addedHostNames = null, IEnumerable removedHostNames = null, IEnumerable inMaintenanceHostNames = null) + public static AvsClusterUpdatedEventData AvsClusterUpdatedEventData(string operationId = default, IEnumerable addedHostNames = default, IEnumerable removedHostNames = default, IEnumerable inMaintenanceHostNames = default) { - addedHostNames ??= new List(); - removedHostNames ??= new List(); - inMaintenanceHostNames ??= new List(); + addedHostNames ??= new ChangeTrackingList(); + removedHostNames ??= new ChangeTrackingList(); + inMaintenanceHostNames ??= new ChangeTrackingList(); - return new AvsClusterUpdatedEventData(operationId, addedHostNames?.ToList(), removedHostNames?.ToList(), inMaintenanceHostNames?.ToList(), serializedAdditionalRawData: null); + return new AvsClusterUpdatedEventData(operationId, addedHostNames.ToList(), removedHostNames.ToList(), inMaintenanceHostNames.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ClusterFailed event. /// Id of the operation that caused this event. /// Hosts added to the cluster in this event, if any. /// Hosts removed from the cluster in this event, if any. /// Hosts in Maintenance mode in the cluster, if any. /// Failure reason of an event. /// A new instance for mocking. - public static AvsClusterFailedEventData AvsClusterFailedEventData(string operationId = null, IEnumerable addedHostNames = null, IEnumerable removedHostNames = null, IEnumerable inMaintenanceHostNames = null, string failureMessage = null) + public static AvsClusterFailedEventData AvsClusterFailedEventData(string operationId = default, IEnumerable addedHostNames = default, IEnumerable removedHostNames = default, IEnumerable inMaintenanceHostNames = default, string failureMessage = default) { - addedHostNames ??= new List(); - removedHostNames ??= new List(); - inMaintenanceHostNames ??= new List(); + addedHostNames ??= new ChangeTrackingList(); + removedHostNames ??= new ChangeTrackingList(); + inMaintenanceHostNames ??= new ChangeTrackingList(); return new AvsClusterFailedEventData( operationId, - addedHostNames?.ToList(), - removedHostNames?.ToList(), - inMaintenanceHostNames?.ToList(), - serializedAdditionalRawData: null, + addedHostNames.ToList(), + removedHostNames.ToList(), + inMaintenanceHostNames.ToList(), + additionalBinaryDataProperties: null, failureMessage); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for Microsoft.AVS/scriptExecutions events. /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. /// A new instance for mocking. - public static AvsScriptExecutionEventData AvsScriptExecutionEventData(string operationId = null, string cmdletId = null, IEnumerable output = null) + public static AvsScriptExecutionEventData AvsScriptExecutionEventData(string operationId = default, string cmdletId = default, IEnumerable output = default) { - output ??= new List(); + output ??= new ChangeTrackingList(); - return new AvsScriptExecutionEventData(operationId, cmdletId, output?.ToList(), serializedAdditionalRawData: null); + return new AvsScriptExecutionEventData(operationId, cmdletId, output.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionStarted event. /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. /// A new instance for mocking. - public static AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventData(string operationId = null, string cmdletId = null, IEnumerable output = null) + public static AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventData(string operationId = default, string cmdletId = default, IEnumerable output = default) { - output ??= new List(); + output ??= new ChangeTrackingList(); - return new AvsScriptExecutionStartedEventData(operationId, cmdletId, output?.ToList(), serializedAdditionalRawData: null); + return new AvsScriptExecutionStartedEventData(operationId, cmdletId, output.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionFinished event. /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. /// Named outputs of completed execution, if any. /// A new instance for mocking. - public static AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = null, string cmdletId = null, IEnumerable output = null, IReadOnlyDictionary namedOutputs = null) + public static AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = default, string cmdletId = default, IEnumerable output = default, IDictionary namedOutputs = default) { - output ??= new List(); - namedOutputs ??= new Dictionary(); + output ??= new ChangeTrackingList(); + namedOutputs ??= new ChangeTrackingDictionary(); - return new AvsScriptExecutionFinishedEventData(operationId, cmdletId, output?.ToList(), serializedAdditionalRawData: null, namedOutputs); + return new AvsScriptExecutionFinishedEventData(operationId, cmdletId, output.ToList(), additionalBinaryDataProperties: null, namedOutputs); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionCancelled event. /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. /// A new instance for mocking. - public static AvsScriptExecutionCancelledEventData AvsScriptExecutionCancelledEventData(string operationId = null, string cmdletId = null, IEnumerable output = null) + public static AvsScriptExecutionCancelledEventData AvsScriptExecutionCancelledEventData(string operationId = default, string cmdletId = default, IEnumerable output = default) { - output ??= new List(); + output ??= new ChangeTrackingList(); - return new AvsScriptExecutionCancelledEventData(operationId, cmdletId, output?.ToList(), serializedAdditionalRawData: null); + return new AvsScriptExecutionCancelledEventData(operationId, cmdletId, output.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionFailed event. /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. /// Stdout outputs from the execution, if any. /// Failure reason of an event. /// A new instance for mocking. - public static AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventData(string operationId = null, string cmdletId = null, IEnumerable output = null, string failureMessage = null) + public static AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventData(string operationId = default, string cmdletId = default, IEnumerable output = default, string failureMessage = default) { - output ??= new List(); + output ??= new ChangeTrackingList(); - return new AvsScriptExecutionFailedEventData(operationId, cmdletId, output?.ToList(), serializedAdditionalRawData: null, failureMessage); + return new AvsScriptExecutionFailedEventData(operationId, cmdletId, output.ToList(), additionalBinaryDataProperties: null, failureMessage); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.IncomingCall event. /// The communication identifier of the target user. /// The communication identifier of the user who initiated the call. /// The Id of the server call. @@ -578,7 +579,7 @@ public static AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventDat /// The communication identifier of the user on behalf of whom the call is made. /// CorrelationId (CallId). /// A new instance for mocking. - public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationIdentifier = null, CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, CommunicationIdentifierModel onBehalfOfCallee = null, string correlationId = null) + public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationIdentifier = default, CommunicationIdentifierModel fromCommunicationIdentifier = default, string serverCallId = default, string callerDisplayName = default, AcsIncomingCallCustomContext customContext = default, string incomingCallContext = default, CommunicationIdentifierModel onBehalfOfCallee = default, string correlationId = default) { return new AcsIncomingCallEventData( toCommunicationIdentifier, @@ -589,10 +590,10 @@ public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIde incomingCallContext, onBehalfOfCallee, correlationId, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. /// The identifier kind. Only required in responses. /// Raw Id of the identifier. Optional in requests, required in responses. /// The communication user. @@ -600,7 +601,7 @@ public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIde /// The Microsoft Teams user. /// The Microsoft Teams application. /// A new instance for mocking. - public static CommunicationIdentifierModel CommunicationIdentifierModel(AcsCommunicationIdentifierKind? kind = null, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, AcsMicrosoftTeamsAppIdentifier microsoftTeamsApp = null) + public static CommunicationIdentifierModel CommunicationIdentifierModel(AcsCommunicationIdentifierKind? kind = default, string rawId = default, CommunicationUserIdentifierModel communicationUser = default, PhoneNumberIdentifierModel phoneNumber = default, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = default, AcsMicrosoftTeamsAppIdentifier microsoftTeamsApp = default) { return new CommunicationIdentifierModel( kind, @@ -609,65 +610,65 @@ public static CommunicationIdentifierModel CommunicationIdentifierModel(AcsCommu phoneNumber, microsoftTeamsUser, microsoftTeamsApp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A user that got created with an Azure Communication Services resource. /// The Id of the communication user. /// A new instance for mocking. - public static CommunicationUserIdentifierModel CommunicationUserIdentifierModel(string id = null) + public static CommunicationUserIdentifierModel CommunicationUserIdentifierModel(string id = default) { - return new CommunicationUserIdentifierModel(id, serializedAdditionalRawData: null); + return new CommunicationUserIdentifierModel(id, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A phone number. /// The phone number in E.164 format. /// A new instance for mocking. - public static PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value = null) + public static PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value = default) { - return new PhoneNumberIdentifierModel(value, serializedAdditionalRawData: null); + return new PhoneNumberIdentifierModel(value, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A Microsoft Teams user. /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. /// True if the Microsoft Teams user is anonymous. By default false if missing. /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// A new instance for mocking. - public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = null, CommunicationCloudEnvironmentModel? cloud = null) + public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = default, bool? isAnonymous = default, CommunicationCloudEnvironmentModel? cloud = default) { - return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, serializedAdditionalRawData: null); + return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A Microsoft Teams application. /// The Id of the Microsoft Teams application. /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// A new instance for mocking. - public static AcsMicrosoftTeamsAppIdentifier AcsMicrosoftTeamsAppIdentifier(string appId = null, CommunicationCloudEnvironmentModel? cloud = null) + public static AcsMicrosoftTeamsAppIdentifier AcsMicrosoftTeamsAppIdentifier(string appId = default, CommunicationCloudEnvironmentModel? cloud = default) { - return new AcsMicrosoftTeamsAppIdentifier(appId, cloud, serializedAdditionalRawData: null); + return new AcsMicrosoftTeamsAppIdentifier(appId, cloud, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Custom Context of Incoming Call. /// Sip Headers for incoming call. /// Voip Headers for incoming call. /// A new instance for mocking. - public static AcsIncomingCallCustomContext AcsIncomingCallCustomContext(IReadOnlyDictionary sipHeaders = null, IReadOnlyDictionary voipHeaders = null) + public static AcsIncomingCallCustomContext AcsIncomingCallCustomContext(IDictionary sipHeaders = default, IDictionary voipHeaders = default) { - sipHeaders ??= new Dictionary(); - voipHeaders ??= new Dictionary(); + sipHeaders ??= new ChangeTrackingDictionary(); + voipHeaders ??= new ChangeTrackingDictionary(); - return new AcsIncomingCallCustomContext(sipHeaders, voipHeaders, serializedAdditionalRawData: null); + return new AcsIncomingCallCustomContext(sipHeaders, voipHeaders, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event. /// The communication identifier of the user who was disconnected. /// A new instance for mocking. - public static AcsUserDisconnectedEventData AcsUserDisconnectedEventData(CommunicationIdentifierModel userCommunicationIdentifier = null) + public static AcsUserDisconnectedEventData AcsUserDisconnectedEventData(CommunicationIdentifierModel userCommunicationIdentifier = default) { - return new AcsUserDisconnectedEventData(userCommunicationIdentifier, serializedAdditionalRawData: null); + return new AcsUserDisconnectedEventData(userCommunicationIdentifier, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all calling events. /// The call participant who initiated the call. /// The call id of the server. /// The group metadata. @@ -676,45 +677,45 @@ public static AcsUserDisconnectedEventData AcsUserDisconnectedEventData(Communic /// The correlationId of calling event. /// Is the calling event a room call. /// A new instance for mocking. - public static AcsCallingEventProperties AcsCallingEventProperties(AcsCallParticipantProperties startedBy = null, string serverCallId = null, AcsCallGroupProperties group = null, AcsCallRoomProperties room = null, bool? isTwoParty = null, string correlationId = null, bool? isRoomsCall = null) + public static AcsCallingEventProperties AcsCallingEventProperties(AcsCallParticipantProperties startedBy = default, string serverCallId = default, AcsCallGroupProperties @group = default, AcsCallRoomProperties room = default, bool? isTwoParty = default, string correlationId = default, bool? isRoomsCall = default) { return new AcsCallingEventProperties( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all participant event user. /// The communication identifier of the participant user. /// The role of the participant. /// A new instance for mocking. - public static AcsCallParticipantProperties AcsCallParticipantProperties(CommunicationIdentifierModel communicationIdentifier = null, AcsCallParticipantKind? role = null) + public static AcsCallParticipantProperties AcsCallParticipantProperties(CommunicationIdentifierModel communicationIdentifier = default, AcsCallParticipantKind? role = default) { - return new AcsCallParticipantProperties(communicationIdentifier, role, serializedAdditionalRawData: null); + return new AcsCallParticipantProperties(communicationIdentifier, role, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of calling event group properties. /// Group Id. /// A new instance for mocking. - public static AcsCallGroupProperties AcsCallGroupProperties(string id = null) + public static AcsCallGroupProperties AcsCallGroupProperties(string id = default) { - return new AcsCallGroupProperties(id, serializedAdditionalRawData: null); + return new AcsCallGroupProperties(id, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of calling event room properties. /// Room Id. /// A new instance for mocking. - public static AcsCallRoomProperties AcsCallRoomProperties(string id = null) + public static AcsCallRoomProperties AcsCallRoomProperties(string id = default) { - return new AcsCallRoomProperties(id, serializedAdditionalRawData: null); + return new AcsCallRoomProperties(id, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallStarted event. /// The call participant who initiated the call. /// The call id of the server. /// The group metadata. @@ -723,20 +724,20 @@ public static AcsCallRoomProperties AcsCallRoomProperties(string id = null) /// The correlationId of calling event. /// Is the calling event a room call. /// A new instance for mocking. - public static AcsCallStartedEventData AcsCallStartedEventData(AcsCallParticipantProperties startedBy = null, string serverCallId = null, AcsCallGroupProperties group = null, AcsCallRoomProperties room = null, bool? isTwoParty = null, string correlationId = null, bool? isRoomsCall = null) + public static AcsCallStartedEventData AcsCallStartedEventData(AcsCallParticipantProperties startedBy = default, string serverCallId = default, AcsCallGroupProperties @group = default, AcsCallRoomProperties room = default, bool? isTwoParty = default, string correlationId = default, bool? isRoomsCall = default) { return new AcsCallStartedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallEnded event. /// The call participant who initiated the call. /// The call id of the server. /// The group metadata. @@ -746,45 +747,45 @@ public static AcsCallStartedEventData AcsCallStartedEventData(AcsCallParticipant /// Is the calling event a room call. /// The communication identifier of the user who was disconnected. /// The reason for ending the call. - /// Duration of the call in seconds. + /// Duration of the call. /// A new instance for mocking. - public static AcsCallEndedEventData AcsCallEndedEventData(AcsCallParticipantProperties startedBy = null, string serverCallId = null, AcsCallGroupProperties group = null, AcsCallRoomProperties room = null, bool? isTwoParty = null, string correlationId = null, bool? isRoomsCall = null, AcsCallEndedByProperties endedBy = null, AcsCallEndReasonProperties reason = null, TimeSpan? callDuration = null) + public static AcsCallEndedEventData AcsCallEndedEventData(AcsCallParticipantProperties startedBy = default, string serverCallId = default, AcsCallGroupProperties @group = default, AcsCallRoomProperties room = default, bool? isTwoParty = default, string correlationId = default, bool? isRoomsCall = default, AcsCallEndedByProperties endedBy = default, AcsCallEndReasonProperties reason = default, TimeSpan? callDuration = default) { return new AcsCallEndedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, endedBy, reason, callDuration); } - /// Initializes a new instance of . + /// Schema of calling event ended by properties. /// The communication identifier of the call ended by. /// The type of call ended by. /// The name of the call ended by. /// A new instance for mocking. - public static AcsCallEndedByProperties AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier = null, AcsCallEndedByKind? kind = null, string name = null) + public static AcsCallEndedByProperties AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier = default, AcsCallEndedByKind? kind = default, string name = default) { - return new AcsCallEndedByProperties(communicationIdentifier, kind, name, serializedAdditionalRawData: null); + return new AcsCallEndedByProperties(communicationIdentifier, kind, name, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of calling event reason properties. /// Reason code for ending the call. /// Reason subcode for ending the call. /// Reason for the ending the call. /// A new instance for mocking. - public static AcsCallEndReasonProperties AcsCallEndReasonProperties(int? code = null, int? subCode = null, string phrase = null) + public static AcsCallEndReasonProperties AcsCallEndReasonProperties(int? code = default, int? subCode = default, string phrase = default) { - return new AcsCallEndReasonProperties(code, subCode, phrase, serializedAdditionalRawData: null); + return new AcsCallEndReasonProperties(code, subCode, phrase, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all participant events. /// The call participant who initiated the call. /// The call id of the server. /// The group metadata. @@ -797,24 +798,24 @@ public static AcsCallEndReasonProperties AcsCallEndReasonProperties(int? code = /// The id of the participant. /// The user agent of the participant. /// A new instance for mocking. - public static AcsCallParticipantEventData AcsCallParticipantEventData(AcsCallParticipantProperties startedBy = null, string serverCallId = null, AcsCallGroupProperties group = null, AcsCallRoomProperties room = null, bool? isTwoParty = null, string correlationId = null, bool? isRoomsCall = null, AcsCallParticipantProperties user = null, string displayName = null, string participantId = null, string userAgent = null) + public static AcsCallParticipantEventData AcsCallParticipantEventData(AcsCallParticipantProperties startedBy = default, string serverCallId = default, AcsCallGroupProperties @group = default, AcsCallRoomProperties room = default, bool? isTwoParty = default, string correlationId = default, bool? isRoomsCall = default, AcsCallParticipantProperties user = default, string displayName = default, string participantId = default, string userAgent = default) { return new AcsCallParticipantEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, user, displayName, participantId, userAgent); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantAdded event. /// The call participant who initiated the call. /// The call id of the server. /// The group metadata. @@ -827,24 +828,24 @@ public static AcsCallParticipantEventData AcsCallParticipantEventData(AcsCallPar /// The id of the participant. /// The user agent of the participant. /// A new instance for mocking. - public static AcsCallParticipantAddedEventData AcsCallParticipantAddedEventData(AcsCallParticipantProperties startedBy = null, string serverCallId = null, AcsCallGroupProperties group = null, AcsCallRoomProperties room = null, bool? isTwoParty = null, string correlationId = null, bool? isRoomsCall = null, AcsCallParticipantProperties user = null, string displayName = null, string participantId = null, string userAgent = null) + public static AcsCallParticipantAddedEventData AcsCallParticipantAddedEventData(AcsCallParticipantProperties startedBy = default, string serverCallId = default, AcsCallGroupProperties @group = default, AcsCallRoomProperties room = default, bool? isTwoParty = default, string correlationId = default, bool? isRoomsCall = default, AcsCallParticipantProperties user = default, string displayName = default, string participantId = default, string userAgent = default) { return new AcsCallParticipantAddedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, user, displayName, participantId, userAgent); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantRemoved event. /// The call participant who initiated the call. /// The call id of the server. /// The group metadata. @@ -857,43 +858,43 @@ public static AcsCallParticipantAddedEventData AcsCallParticipantAddedEventData( /// The id of the participant. /// The user agent of the participant. /// A new instance for mocking. - public static AcsCallParticipantRemovedEventData AcsCallParticipantRemovedEventData(AcsCallParticipantProperties startedBy = null, string serverCallId = null, AcsCallGroupProperties group = null, AcsCallRoomProperties room = null, bool? isTwoParty = null, string correlationId = null, bool? isRoomsCall = null, AcsCallParticipantProperties user = null, string displayName = null, string participantId = null, string userAgent = null) + public static AcsCallParticipantRemovedEventData AcsCallParticipantRemovedEventData(AcsCallParticipantProperties startedBy = default, string serverCallId = default, AcsCallGroupProperties @group = default, AcsCallRoomProperties room = default, bool? isTwoParty = default, string correlationId = default, bool? isRoomsCall = default, AcsCallParticipantProperties user = default, string displayName = default, string participantId = default, string userAgent = default) { return new AcsCallParticipantRemovedEventData( startedBy, serverCallId, - group, + @group, room, isTwoParty, correlationId, isRoomsCall, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, user, displayName, participantId, userAgent); } - /// Initializes a new instance of . + /// Schema of common properties of all chat events. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// A new instance for mocking. - public static AcsChatEventBaseProperties AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null) + public static AcsChatEventBaseProperties AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default) { - return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData: null); + return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all thread-level chat events. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// A new instance for mocking. - public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = null, string threadId = null) + public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = default, string threadId = default) { - return new AcsChatEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData: null); + return new AcsChatEventInThreadBaseProperties(transactionId, threadId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all chat message events. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -904,22 +905,22 @@ public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBasePropert /// The type of the message. /// The version of the message. /// A new instance for mocking. - public static AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null) + public static AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default) { return new AcsChatMessageEventBaseProperties( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -932,26 +933,26 @@ public static AcsChatMessageEventBaseProperties AcsChatMessageEventBasePropertie /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatMessageReceivedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata); } - /// Initializes a new instance of . + /// Schema of common properties of all thread-level chat message events. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. @@ -961,21 +962,21 @@ public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Co /// The type of the message. /// The version of the message. /// A new instance for mocking. - public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null) + public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default) { return new AcsChatMessageEventInThreadBaseProperties( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatAzureBotCommandReceivedInThread event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. @@ -987,25 +988,25 @@ public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThr /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatAzureBotCommandReceivedInThreadEventData AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatAzureBotCommandReceivedInThreadEventData AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatAzureBotCommandReceivedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatTypingIndicatorReceivedInThread event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. @@ -1017,25 +1018,25 @@ public static AcsChatAzureBotCommandReceivedInThreadEventData AcsChatAzureBotCom /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatTypingIndicatorReceivedInThreadEventData AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatTypingIndicatorReceivedInThreadEventData AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatTypingIndicatorReceivedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. @@ -1047,25 +1048,25 @@ public static AcsChatTypingIndicatorReceivedInThreadEventData AcsChatTypingIndic /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatMessageReceivedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1079,27 +1080,27 @@ public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInTh /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset? editTime = null) + public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default, DateTimeOffset? editTime = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatMessageEditedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata, editTime); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. @@ -1112,26 +1113,26 @@ public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Commun /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset? editTime = null) + public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default, DateTimeOffset? editTime = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatMessageEditedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, messageBody, metadata, editTime); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1143,23 +1144,23 @@ public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThread /// The version of the message. /// The time at which the message was deleted. /// A new instance for mocking. - public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, DateTimeOffset? deleteTime = null) + public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, DateTimeOffset? deleteTime = default) { return new AcsChatMessageDeletedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, deleteTime); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. @@ -1170,121 +1171,121 @@ public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Comm /// The version of the message. /// The time at which the message was deleted. /// A new instance for mocking. - public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, DateTimeOffset? deleteTime = null) + public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, DateTimeOffset? deleteTime = default) { return new AcsChatMessageDeletedInThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, - type, + @type, version, deleteTime); } - /// Initializes a new instance of . + /// Schema of common properties of all chat thread events. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. /// A new instance for mocking. - public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) + public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default) { return new AcsChatThreadEventBaseProperties( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who created the thread. - /// The thread properties. + /// Gets the properties of the chat thread created with user event. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel createdByCommunicationIdentifier = default, IReadOnlyDictionary properties = default, IDictionary metadata = default, IEnumerable participants = default) { - properties ??= new Dictionary(); - metadata ??= new Dictionary(); - participants ??= new List(); + properties ??= new ChangeTrackingDictionary(); + metadata ??= new ChangeTrackingDictionary(); + participants ??= new ChangeTrackingList(); return new AcsChatThreadCreatedWithUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, createdByCommunicationIdentifier, properties, metadata, - participants?.ToList()); + participants.ToList()); } - /// Initializes a new instance of . + /// Schema of the chat thread participant. /// The name of the user. /// The communication identifier of the user. /// The metadata of the user. /// A new instance for mocking. - public static AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = null, CommunicationIdentifierModel participantCommunicationIdentifier = null, IReadOnlyDictionary metadata = null) + public static AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = default, CommunicationIdentifierModel participantCommunicationIdentifier = default, IDictionary metadata = default) { - metadata ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); - return new AcsChatThreadParticipantProperties(displayName, participantCommunicationIdentifier, metadata, serializedAdditionalRawData: null); + return new AcsChatThreadParticipantProperties(displayName, participantCommunicationIdentifier, metadata, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all chat thread events. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. /// A new instance for mocking. - public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) + public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default) { - return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData: null, createTime, version); + return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, additionalBinaryDataProperties: null, createTime, version); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who created the thread. - /// The thread properties. + /// Gets the properties of the chat thread created event. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel createdByCommunicationIdentifier = default, IReadOnlyDictionary properties = default, IDictionary metadata = default, IEnumerable participants = default) { - properties ??= new Dictionary(); - metadata ??= new Dictionary(); - participants ??= new List(); + properties ??= new ChangeTrackingDictionary(); + metadata ??= new ChangeTrackingDictionary(); + participants ??= new ChangeTrackingList(); return new AcsChatThreadCreatedEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, createdByCommunicationIdentifier, properties, metadata, - participants?.ToList()); + participants.ToList()); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1293,20 +1294,20 @@ public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. /// A new instance for mocking. - public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) + public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel deletedByCommunicationIdentifier = default, DateTimeOffset? deleteTime = default) { return new AcsChatThreadWithUserDeletedEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, deletedByCommunicationIdentifier, deleteTime); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. @@ -1314,19 +1315,19 @@ public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeleted /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. /// A new instance for mocking. - public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) + public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel deletedByCommunicationIdentifier = default, DateTimeOffset? deleteTime = default) { return new AcsChatThreadDeletedEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, deletedByCommunicationIdentifier, deleteTime); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1335,18 +1336,18 @@ public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string /// The communication identifier of the user who updated the thread properties. /// The time at which the properties of the thread were updated. /// The thread metadata. - /// The updated thread properties. + /// The properties of the chat thread that were updated for the user. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset? editTime = null, IReadOnlyDictionary metadata = null, IReadOnlyDictionary properties = null) + public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel editedByCommunicationIdentifier = default, DateTimeOffset? editTime = default, IDictionary metadata = default, IReadOnlyDictionary properties = default) { - metadata ??= new Dictionary(); - properties ??= new Dictionary(); + metadata ??= new ChangeTrackingDictionary(); + properties ??= new ChangeTrackingDictionary(); return new AcsChatThreadPropertiesUpdatedPerUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, editedByCommunicationIdentifier, @@ -1355,25 +1356,25 @@ public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadProper properties); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. /// The communication identifier of the user who updated the thread properties. /// The time at which the properties of the thread were updated. - /// The updated thread properties. + /// Gets the properties of the chat thread updated event. /// The thread metadata. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset? editTime = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null) + public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel editedByCommunicationIdentifier = default, DateTimeOffset? editTime = default, IReadOnlyDictionary properties = default, IDictionary metadata = default) { - properties ??= new Dictionary(); - metadata ??= new Dictionary(); + properties ??= new ChangeTrackingDictionary(); + metadata ??= new ChangeTrackingDictionary(); return new AcsChatThreadPropertiesUpdatedEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, editedByCommunicationIdentifier, @@ -1382,7 +1383,7 @@ public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpd metadata); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1392,13 +1393,13 @@ public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpd /// The communication identifier of the user who added the user. /// The details of the user who was added. /// A new instance for mocking. - public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null) + public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, DateTimeOffset? time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = default, AcsChatThreadParticipantProperties participantAdded = default) { return new AcsChatParticipantAddedToThreadWithUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, time, @@ -1406,7 +1407,7 @@ public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipan participantAdded); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1416,13 +1417,13 @@ public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipan /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// A new instance for mocking. - public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null) + public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, DateTimeOffset? time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = default, AcsChatThreadParticipantProperties participantRemoved = default) { return new AcsChatParticipantRemovedFromThreadWithUserEventData( recipientCommunicationIdentifier, transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, createTime, version, time, @@ -1430,7 +1431,7 @@ public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatPartic participantRemoved); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The time at which the user was added to the thread. @@ -1438,19 +1439,19 @@ public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatPartic /// The details of the user who was added. /// The version of the thread. /// A new instance for mocking. - public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) + public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = default, string threadId = default, DateTimeOffset? time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = default, AcsChatThreadParticipantProperties participantAdded = default, long? version = default) { return new AcsChatParticipantAddedToThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, time, addedByCommunicationIdentifier, participantAdded, version); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The time at which the user was removed to the thread. @@ -1458,29 +1459,29 @@ public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedTo /// The details of the user who was removed. /// The version of the thread. /// A new instance for mocking. - public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) + public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = default, string threadId = default, DateTimeOffset? time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = default, AcsChatThreadParticipantProperties participantRemoved = default, long? version = default) { return new AcsChatParticipantRemovedFromThreadEventData( transactionId, threadId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, time, removedByCommunicationIdentifier, participantRemoved, version); } - /// Initializes a new instance of . + /// Schema of common properties of all SMS events. /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. /// A new instance for mocking. - public static AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string messageId = null, string @from = null, string to = null) + public static AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string messageId = default, string @from = default, string to = default) { - return new AcsSmsEventBaseProperties(messageId, @from, to, serializedAdditionalRawData: null); + return new AcsSmsEventBaseProperties(messageId, @from, to, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event. /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. @@ -1490,33 +1491,33 @@ public static AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string message /// The time at which the SMS delivery report was received. /// Customer Content. /// A new instance for mocking. - public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string @from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, IEnumerable deliveryAttempts = null, DateTimeOffset? receivedTimestamp = null, string tag = null) + public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = default, string @from = default, string to = default, string deliveryStatus = default, string deliveryStatusDetails = default, IEnumerable deliveryAttempts = default, DateTimeOffset? receivedTimestamp = default, string tag = default) { - deliveryAttempts ??= new List(); + deliveryAttempts ??= new ChangeTrackingList(); return new AcsSmsDeliveryReportReceivedEventData( messageId, @from, to, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, deliveryStatus, deliveryStatusDetails, - deliveryAttempts?.ToList(), + deliveryAttempts.ToList(), receivedTimestamp, tag); } - /// Initializes a new instance of . + /// Schema for details of a delivery attempt. /// TimeStamp when delivery was attempted. /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. /// A new instance for mocking. - public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp = null, int? segmentsSucceeded = null, int? segmentsFailed = null) + public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp = default, int? segmentsSucceeded = default, int? segmentsFailed = default) { - return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, serializedAdditionalRawData: null); + return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event. /// The identity of the SMS message. /// The identity of SMS message sender. /// The identity of SMS message receiver. @@ -1524,19 +1525,19 @@ public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(Da /// The time at which the SMS was received. /// Number of segments in the message. /// A new instance for mocking. - public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset? receivedTimestamp = null, int segmentCount = default) + public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = default, string @from = default, string to = default, string message = default, DateTimeOffset? receivedTimestamp = default, int segmentCount = default) { return new AcsSmsReceivedEventData( messageId, @from, to, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, message, receivedTimestamp, segmentCount); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event. /// The details of recording storage information. /// The time at which the recording started. /// The recording duration in milliseconds. @@ -1545,7 +1546,7 @@ public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = /// The recording format type - Mp4, Mp3, Wav. /// The reason for ending recording session. /// A new instance for mocking. - public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = null, DateTimeOffset? recordingStartTime = null, long? recordingDurationMs = null, AcsRecordingContentType? contentType = null, AcsRecordingChannelType? channelType = null, AcsRecordingFormatType? formatType = null, string sessionEndReason = null) + public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = default, DateTimeOffset? recordingStartTime = default, long? recordingDurationMs = default, AcsRecordingContentType? contentType = default, AcsRecordingChannelType? channelType = default, AcsRecordingFormatType? formatType = default, string sessionEndReason = default) { return new AcsRecordingFileStatusUpdatedEventData( recordingStorageInfo, @@ -1555,20 +1556,20 @@ public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdat channelType, formatType, sessionEndReason, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema for all properties of Recording Storage Information. /// List of details of recording chunks information. /// A new instance for mocking. - public static AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(IEnumerable recordingChunks = null) + public static AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(IEnumerable recordingChunks = default) { - recordingChunks ??= new List(); + recordingChunks ??= new ChangeTrackingList(); - return new AcsRecordingStorageInfoProperties(recordingChunks?.ToList(), serializedAdditionalRawData: null); + return new AcsRecordingStorageInfoProperties(recordingChunks.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema for all properties of Recording Chunk Information. /// The documentId of the recording chunk. /// The index of the recording chunk. /// The reason for ending the recording chunk. @@ -1576,7 +1577,7 @@ public static AcsRecordingStorageInfoProperties AcsRecordingStorageInfoPropertie /// The location of the content for this chunk. /// The location to delete all chunk storage. /// A new instance for mocking. - public static AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(string documentId = null, long? index = null, string endReason = null, string metadataLocation = null, string contentLocation = null, string deleteLocation = null) + public static AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(string documentId = default, long? index = default, string endReason = default, string metadataLocation = default, string contentLocation = default, string deleteLocation = default) { return new AcsRecordingChunkInfoProperties( documentId, @@ -1585,10 +1586,10 @@ public static AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(st metadataLocation, contentLocation, deleteLocation, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailDeliveryReportReceived event. /// The Sender Email Address. /// The recipient Email Address. /// The Internet Message Id of the email that has been sent. @@ -1597,7 +1598,7 @@ public static AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(st /// Detailed information about the status if any. /// The time at which the email delivery report received timestamp. /// A new instance for mocking. - public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string internetMessageId = null, string messageId = null, AcsEmailDeliveryReportStatus? status = null, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset? deliveryAttemptTimestamp = null) + public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = default, string recipient = default, string internetMessageId = default, string messageId = default, AcsEmailDeliveryReportStatus? status = default, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = default, DateTimeOffset? deliveryAttemptTimestamp = default) { return new AcsEmailDeliveryReportReceivedEventData( sender, @@ -1607,19 +1608,19 @@ public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportRece status, deliveryStatusDetails, deliveryAttemptTimestamp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Detailed information about the status if any. /// Detailed status message. /// Recipient mail server host name. /// A new instance for mocking. - public static AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = null, string recipientMailServerHostName = null) + public static AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = default, string recipientMailServerHostName = default) { - return new AcsEmailDeliveryReportStatusDetails(statusMessage, recipientMailServerHostName, serializedAdditionalRawData: null); + return new AcsEmailDeliveryReportStatusDetails(statusMessage, recipientMailServerHostName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailEngagementTrackingReportReceived event. /// The Sender Email Address. /// The Recipient Email Address. /// The Id of the email that has been sent. @@ -1628,7 +1629,7 @@ public static AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDe /// The user agent interacting with the email. /// The type of engagement user have with email. /// A new instance for mocking. - public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, DateTimeOffset? userActionTimestamp = null, string engagementContext = null, string userAgent = null, AcsUserEngagement? engagement = null) + public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = default, string recipient = default, string messageId = default, DateTimeOffset? userActionTimestamp = default, string engagementContext = default, string userAgent = default, AcsUserEngagement? engagement = default) { return new AcsEmailEngagementTrackingReportReceivedEventData( sender, @@ -1638,20 +1639,20 @@ public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngageme engagementContext, userAgent, engagement, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all Router events. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. /// A new instance for mocking. - public static AcsRouterEventData AcsRouterEventData(string jobId = null, string channelReference = null, string channelId = null) + public static AcsRouterEventData AcsRouterEventData(string jobId = default, string channelReference = default, string channelId = default) { - return new AcsRouterEventData(jobId, channelReference, channelId, serializedAdditionalRawData: null); + return new AcsRouterEventData(jobId, channelReference, channelId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of all Router Job events. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1659,22 +1660,22 @@ public static AcsRouterEventData AcsRouterEventData(string jobId = null, string /// Router Job events Labels. /// Router Jobs events Tags. /// A new instance for mocking. - public static AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null) + public static AcsRouterJobEventData AcsRouterJobEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobCancelled event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1684,16 +1685,16 @@ public static AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, s /// Router Job Note. /// Router Job Disposition Code. /// A new instance for mocking. - public static AcsRouterJobCancelledEventData AcsRouterJobCancelledEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string note = null, string dispositionCode = null) + public static AcsRouterJobCancelledEventData AcsRouterJobCancelledEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, string note = default, string dispositionCode = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobCancelledEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, @@ -1701,7 +1702,7 @@ public static AcsRouterJobCancelledEventData AcsRouterJobCancelledEventData(stri dispositionCode); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClassified event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1713,39 +1714,59 @@ public static AcsRouterJobCancelledEventData AcsRouterJobCancelledEventData(stri /// Router Job Priority. /// Router Job Attached Worker Selector. /// A new instance for mocking. - public static AcsRouterJobClassifiedEventData AcsRouterJobClassifiedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterQueueDetails queueDetails = null, string classificationPolicyId = null, int? priority = null, IEnumerable attachedWorkerSelectors = null) + public static AcsRouterJobClassifiedEventData AcsRouterJobClassifiedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, AcsRouterQueueDetails queueDetails = default, string classificationPolicyId = default, int? priority = default, IEnumerable attachedWorkerSelectors = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); - attachedWorkerSelectors ??= new List(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + attachedWorkerSelectors ??= new ChangeTrackingList(); return new AcsRouterJobClassifiedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, queueDetails, classificationPolicyId, priority, - attachedWorkerSelectors?.ToList()); + attachedWorkerSelectors.ToList()); } - /// Initializes a new instance of . + /// Router Queue Details. /// Router Queue Id. /// Router Queue Name. /// Router Queue Labels. /// A new instance for mocking. - public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, IReadOnlyDictionary labels = null) + public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = default, string name = default, IDictionary labels = default) { - labels ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); - return new AcsRouterQueueDetails(id, name, labels, serializedAdditionalRawData: null); + return new AcsRouterQueueDetails(id, name, labels, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Router Job Worker Selector. + /// Router Job Worker Selector Key. + /// Router Job Worker Selector Label Operator. + /// Router Job Worker Selector Value. + /// + /// Router Job Worker Selector State. + /// Router Job Worker Selector Expiration Time. + /// A new instance for mocking. + public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = default, AcsRouterLabelOperator? @operator = default, object labelValue = default, double? ttlSeconds = default, AcsRouterWorkerSelectorState? selectorState = default, DateTimeOffset? expirationTime = default) + { + return new AcsRouterWorkerSelector( + key, + @operator, + labelValue, + ttlSeconds, + selectorState, + expirationTime, + additionalBinaryDataProperties: null); + } + + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClosed event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1756,16 +1777,16 @@ public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, stri /// Router Job Closed Worker Id. /// Router Job Closed Disposition Code. /// A new instance for mocking. - public static AcsRouterJobClosedEventData AcsRouterJobClosedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null, string dispositionCode = null) + public static AcsRouterJobClosedEventData AcsRouterJobClosedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, string assignmentId = default, string workerId = default, string dispositionCode = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobClosedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, @@ -1774,7 +1795,7 @@ public static AcsRouterJobClosedEventData AcsRouterJobClosedEventData(string job dispositionCode); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobCompleted event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1784,16 +1805,16 @@ public static AcsRouterJobClosedEventData AcsRouterJobClosedEventData(string job /// Router Job Completed Assignment Id. /// Router Job Completed Worker Id. /// A new instance for mocking. - public static AcsRouterJobCompletedEventData AcsRouterJobCompletedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) + public static AcsRouterJobCompletedEventData AcsRouterJobCompletedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, string assignmentId = default, string workerId = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobCompletedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, @@ -1801,7 +1822,7 @@ public static AcsRouterJobCompletedEventData AcsRouterJobCompletedEventData(stri workerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobDeleted event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1809,22 +1830,22 @@ public static AcsRouterJobCompletedEventData AcsRouterJobCompletedEventData(stri /// Router Job events Labels. /// Router Jobs events Tags. /// A new instance for mocking. - public static AcsRouterJobDeletedEventData AcsRouterJobDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null) + public static AcsRouterJobDeletedEventData AcsRouterJobDeletedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobDeletedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobExceptionTriggered event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1834,16 +1855,16 @@ public static AcsRouterJobDeletedEventData AcsRouterJobDeletedEventData(string j /// Router Job Exception Triggered Rule Key. /// Router Job Exception Triggered Rule Id. /// A new instance for mocking. - public static AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) + public static AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, string ruleKey = default, string exceptionRuleId = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobExceptionTriggeredEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, @@ -1851,7 +1872,7 @@ public static AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTrigg exceptionRuleId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobQueued event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1862,27 +1883,27 @@ public static AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTrigg /// Router Job Queued Attached Worker Selector. /// Router Job Queued Requested Worker Selector. /// A new instance for mocking. - public static AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable attachedWorkerSelectors = null, IEnumerable requestedWorkerSelectors = null) + public static AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, int? priority = default, IEnumerable attachedWorkerSelectors = default, IEnumerable requestedWorkerSelectors = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); - attachedWorkerSelectors ??= new List(); - requestedWorkerSelectors ??= new List(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + attachedWorkerSelectors ??= new ChangeTrackingList(); + requestedWorkerSelectors ??= new ChangeTrackingList(); return new AcsRouterJobQueuedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, priority, - attachedWorkerSelectors?.ToList(), - requestedWorkerSelectors?.ToList()); + attachedWorkerSelectors.ToList(), + requestedWorkerSelectors.ToList()); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobReceived event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1896,29 +1917,29 @@ public static AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string job /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. /// A new instance for mocking. - public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus? status = null, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) + public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, AcsRouterJobStatus? status = default, string classificationPolicyId = default, int? priority = default, IEnumerable requestedWorkerSelectors = default, DateTimeOffset? scheduledOn = default, bool unavailableForMatching = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); - requestedWorkerSelectors ??= new List(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + requestedWorkerSelectors ??= new ChangeTrackingList(); return new AcsRouterJobReceivedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, status, classificationPolicyId, priority, - requestedWorkerSelectors?.ToList(), + requestedWorkerSelectors.ToList(), scheduledOn, unavailableForMatching); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobSchedulingFailed event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1931,29 +1952,29 @@ public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string /// Router Job Scheduling Failed Scheduled Time in UTC. /// Router Job Scheduling Failed Reason. /// A new instance for mocking. - public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, string failureReason = null) + public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, int? priority = default, IEnumerable expiredAttachedWorkerSelectors = default, IEnumerable expiredRequestedWorkerSelectors = default, DateTimeOffset? scheduledOn = default, string failureReason = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); - expiredAttachedWorkerSelectors ??= new List(); - expiredRequestedWorkerSelectors ??= new List(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + expiredAttachedWorkerSelectors ??= new ChangeTrackingList(); + expiredRequestedWorkerSelectors ??= new ChangeTrackingList(); return new AcsRouterJobSchedulingFailedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, priority, - expiredAttachedWorkerSelectors?.ToList(), - expiredRequestedWorkerSelectors?.ToList(), + expiredAttachedWorkerSelectors.ToList(), + expiredRequestedWorkerSelectors.ToList(), scheduledOn, failureReason); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobUnassigned event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1963,16 +1984,16 @@ public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailed /// Router Job Unassigned Assignment Id. /// Router Job Unassigned Worker Id. /// A new instance for mocking. - public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) + public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, string assignmentId = default, string workerId = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterJobUnassignedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, @@ -1980,7 +2001,7 @@ public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(st workerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobWaitingForActivation event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -1993,29 +2014,29 @@ public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(st /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. /// A new instance for mocking. - public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) + public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, int? priority = default, IEnumerable expiredAttachedWorkerSelectors = default, IEnumerable expiredRequestedWorkerSelectors = default, DateTimeOffset? scheduledOn = default, bool unavailableForMatching = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); - expiredAttachedWorkerSelectors ??= new List(); - expiredRequestedWorkerSelectors ??= new List(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + expiredAttachedWorkerSelectors ??= new ChangeTrackingList(); + expiredRequestedWorkerSelectors ??= new ChangeTrackingList(); return new AcsRouterJobWaitingForActivationEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, priority, - expiredAttachedWorkerSelectors?.ToList(), - expiredRequestedWorkerSelectors?.ToList(), + expiredAttachedWorkerSelectors.ToList(), + expiredRequestedWorkerSelectors.ToList(), scheduledOn, unavailableForMatching); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobWorkerSelectorsExpired event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -2025,56 +2046,56 @@ public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForAc /// Router Job Worker Selectors Expired Requested Worker Selectors. /// Router Job Worker Selectors Expired Attached Worker Selectors. /// A new instance for mocking. - public static AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, IEnumerable expiredRequestedWorkerSelectors = null, IEnumerable expiredAttachedWorkerSelectors = null) + public static AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = default, string channelReference = default, string channelId = default, string queueId = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, IEnumerable expiredRequestedWorkerSelectors = default, IEnumerable expiredAttachedWorkerSelectors = default) { - labels ??= new Dictionary(); - tags ??= new Dictionary(); - expiredRequestedWorkerSelectors ??= new List(); - expiredAttachedWorkerSelectors ??= new List(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + expiredRequestedWorkerSelectors ??= new ChangeTrackingList(); + expiredAttachedWorkerSelectors ??= new ChangeTrackingList(); return new AcsRouterJobWorkerSelectorsExpiredEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, queueId, labels, tags, - expiredRequestedWorkerSelectors?.ToList(), - expiredAttachedWorkerSelectors?.ToList()); + expiredRequestedWorkerSelectors.ToList(), + expiredAttachedWorkerSelectors.ToList()); } - /// Initializes a new instance of . + /// Schema of common properties of all Router Worker events. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. /// Router Worker events Worker Id. /// A new instance for mocking. - public static AcsRouterWorkerEventData AcsRouterWorkerEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) + public static AcsRouterWorkerEventData AcsRouterWorkerEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default) { - return new AcsRouterWorkerEventData(jobId, channelReference, channelId, serializedAdditionalRawData: null, workerId); + return new AcsRouterWorkerEventData(jobId, channelReference, channelId, additionalBinaryDataProperties: null, workerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerDeleted event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. /// Router Worker events Worker Id. /// A new instance for mocking. - public static AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) + public static AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default) { - return new AcsRouterWorkerDeletedEventData(jobId, channelReference, channelId, serializedAdditionalRawData: null, workerId); + return new AcsRouterWorkerDeletedEventData(jobId, channelReference, channelId, additionalBinaryDataProperties: null, workerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerDeregistered event. /// Router Worker Deregistered Worker Id. /// A new instance for mocking. - public static AcsRouterWorkerDeregisteredEventData AcsRouterWorkerDeregisteredEventData(string workerId = null) + public static AcsRouterWorkerDeregisteredEventData AcsRouterWorkerDeregisteredEventData(string workerId = default) { - return new AcsRouterWorkerDeregisteredEventData(workerId, serializedAdditionalRawData: null); + return new AcsRouterWorkerDeregisteredEventData(workerId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferAccepted event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -2088,18 +2109,18 @@ public static AcsRouterWorkerDeregisteredEventData AcsRouterWorkerDeregisteredEv /// Router Worker Offer Accepted Job Labels. /// Router Worker Offer Accepted Job Tags. /// A new instance for mocking. - public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, string assignmentId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default, string assignmentId = default, int? jobPriority = default, IDictionary workerLabels = default, IDictionary workerTags = default, IDictionary jobLabels = default, IDictionary jobTags = default) { - workerLabels ??= new Dictionary(); - workerTags ??= new Dictionary(); - jobLabels ??= new Dictionary(); - jobTags ??= new Dictionary(); + workerLabels ??= new ChangeTrackingDictionary(); + workerTags ??= new ChangeTrackingDictionary(); + jobLabels ??= new ChangeTrackingDictionary(); + jobTags ??= new ChangeTrackingDictionary(); return new AcsRouterWorkerOfferAcceptedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, workerId, queueId, offerId, @@ -2111,7 +2132,7 @@ public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAccepted jobTags); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferDeclined event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -2119,19 +2140,19 @@ public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAccepted /// Router Worker Offer Declined Queue Id. /// Router Worker Offer Declined Offer Id. /// A new instance for mocking. - public static AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) + public static AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default) { return new AcsRouterWorkerOfferDeclinedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, workerId, queueId, offerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferExpired event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -2139,19 +2160,19 @@ public static AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclined /// Router Worker Offer Expired Queue Id. /// Router Worker Offer Expired Offer Id. /// A new instance for mocking. - public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) + public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default) { return new AcsRouterWorkerOfferExpiredEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, workerId, queueId, offerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferIssued event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -2166,18 +2187,18 @@ public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEv /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. /// A new instance for mocking. - public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset? offeredOn = null, DateTimeOffset? expiresOn = null, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default, int? jobPriority = default, IDictionary workerLabels = default, DateTimeOffset? offeredOn = default, DateTimeOffset? expiresOn = default, IDictionary workerTags = default, IDictionary jobLabels = default, IDictionary jobTags = default) { - workerLabels ??= new Dictionary(); - workerTags ??= new Dictionary(); - jobLabels ??= new Dictionary(); - jobTags ??= new Dictionary(); + workerLabels ??= new ChangeTrackingDictionary(); + workerTags ??= new ChangeTrackingDictionary(); + jobLabels ??= new ChangeTrackingDictionary(); + jobTags ??= new ChangeTrackingDictionary(); return new AcsRouterWorkerOfferIssuedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, workerId, queueId, offerId, @@ -2190,7 +2211,7 @@ public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEven jobTags); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferRevoked event. /// Router Event Job ID. /// Router Event Channel Reference. /// Router Event Channel ID. @@ -2198,19 +2219,19 @@ public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEven /// Router Worker Offer Revoked Queue Id. /// Router Worker Offer Revoked Offer Id. /// A new instance for mocking. - public static AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) + public static AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default) { return new AcsRouterWorkerOfferRevokedEventData( jobId, channelReference, channelId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, workerId, queueId, offerId); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerRegistered event. /// Router Worker Registered Worker Id. /// Router Worker Registered Queue Info. /// Router Worker Registered Channel Configuration. @@ -2218,34 +2239,34 @@ public static AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEv /// Router Worker Registered Labels. /// Router Worker Registered Tags. /// A new instance for mocking. - public static AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, IEnumerable queueAssignments = null, IEnumerable channelConfigurations = null, int? totalCapacity = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null) + public static AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = default, IEnumerable queueAssignments = default, IEnumerable channelConfigurations = default, int? totalCapacity = default, IDictionary labels = default, IDictionary tags = default) { - queueAssignments ??= new List(); - channelConfigurations ??= new List(); - labels ??= new Dictionary(); - tags ??= new Dictionary(); + queueAssignments ??= new ChangeTrackingList(); + channelConfigurations ??= new ChangeTrackingList(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); return new AcsRouterWorkerRegisteredEventData( workerId, - queueAssignments?.ToList(), - channelConfigurations?.ToList(), + queueAssignments.ToList(), + channelConfigurations.ToList(), totalCapacity, labels, tags, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Router Channel Configuration. /// Channel ID for Router Job. /// Capacity Cost Per Job for Router Job. /// Max Number of Jobs for Router Job. /// A new instance for mocking. - public static AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = null, int? maxNumberOfJobs = null) + public static AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = default, int? capacityCostPerJob = default, int? maxNumberOfJobs = default) { - return new AcsRouterChannelConfiguration(channelId, capacityCostPerJob, maxNumberOfJobs, serializedAdditionalRawData: null); + return new AcsRouterChannelConfiguration(channelId, capacityCostPerJob, maxNumberOfJobs, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerUpdated event. /// Router Worker Updated Worker Id. /// Router Worker Updated Queue Info. /// Router Worker Updated Channel Configuration. @@ -2254,33 +2275,33 @@ public static AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string /// Router Worker Updated Tags. /// Router Worker Properties Updated. /// A new instance for mocking. - public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = null, IEnumerable queueAssignments = null, IEnumerable channelConfigurations = null, int? totalCapacity = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, IEnumerable updatedWorkerProperties = null) + public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = default, IEnumerable queueAssignments = default, IEnumerable channelConfigurations = default, int? totalCapacity = default, IDictionary labels = default, IDictionary tags = default, IEnumerable updatedWorkerProperties = default) { - queueAssignments ??= new List(); - channelConfigurations ??= new List(); - labels ??= new Dictionary(); - tags ??= new Dictionary(); - updatedWorkerProperties ??= new List(); + queueAssignments ??= new ChangeTrackingList(); + channelConfigurations ??= new ChangeTrackingList(); + labels ??= new ChangeTrackingDictionary(); + tags ??= new ChangeTrackingDictionary(); + updatedWorkerProperties ??= new ChangeTrackingList(); return new AcsRouterWorkerUpdatedEventData( workerId, - queueAssignments?.ToList(), - channelConfigurations?.ToList(), + queueAssignments.ToList(), + channelConfigurations.ToList(), totalCapacity, labels, tags, - updatedWorkerProperties?.ToList(), - serializedAdditionalRawData: null); + updatedWorkerProperties.ToList(), + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Media Content. /// Required. The MIME type of the file this media represents. /// Required. The media identifier. /// Optional. The filename of the underlying media file as specified when uploaded. /// Optional. The caption for the media object, if supported and provided. /// Optional. Set to true if the sticker is animated; false otherwise. /// A new instance for mocking. - public static AcsMessageMediaContent AcsMessageMediaContent(string mimeType = null, string mediaId = null, string fileName = null, string caption = null, bool? animated = null) + public static AcsMessageMediaContent AcsMessageMediaContent(string mimeType = default, string mediaId = default, string fileName = default, string caption = default, bool? animated = default) { return new AcsMessageMediaContent( mimeType, @@ -2288,66 +2309,66 @@ public static AcsMessageMediaContent AcsMessageMediaContent(string mimeType = nu fileName, caption, animated, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Reaction Content. /// Required. WhatsApp message ID of the message that the emoji is applied to. /// Optional. Unicode escape sequence of the emoji. /// A new instance for mocking. - public static AcsMessageReactionContent AcsMessageReactionContent(string messageId = null, string emoji = null) + public static AcsMessageReactionContent AcsMessageReactionContent(string messageId = default, string emoji = default) { - return new AcsMessageReactionContent(messageId, emoji, serializedAdditionalRawData: null); + return new AcsMessageReactionContent(messageId, emoji, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Context. /// The WhatsApp ID for the customer who replied to an inbound message. /// The message ID for the sent message for an inbound reply. /// A new instance for mocking. - public static AcsMessageContext AcsMessageContext(string @from = null, string messageId = null) + public static AcsMessageContext AcsMessageContext(string @from = default, string messageId = default) { - return new AcsMessageContext(@from, messageId, serializedAdditionalRawData: null); + return new AcsMessageContext(@from, messageId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Button Content. /// The Text of the button. /// The Payload of the button which was clicked by the user, setup by the business. /// A new instance for mocking. - public static AcsMessageButtonContent AcsMessageButtonContent(string text = null, string payload = null) + public static AcsMessageButtonContent AcsMessageButtonContent(string text = default, string payload = default) { - return new AcsMessageButtonContent(text, payload, serializedAdditionalRawData: null); + return new AcsMessageButtonContent(text, payload, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Interactive Content. /// The Message interactive reply type. /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// A new instance for mocking. - public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind = null, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) + public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind = default, AcsMessageInteractiveButtonReplyContent buttonReply = default, AcsMessageInteractiveListReplyContent listReply = default) { - return new AcsMessageInteractiveContent(replyKind, buttonReply, listReply, serializedAdditionalRawData: null); + return new AcsMessageInteractiveContent(replyKind, buttonReply, listReply, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Interactive button reply content for a user to business message. /// The ID of the button. /// The title of the button. /// A new instance for mocking. - public static AcsMessageInteractiveButtonReplyContent AcsMessageInteractiveButtonReplyContent(string buttonId = null, string title = null) + public static AcsMessageInteractiveButtonReplyContent AcsMessageInteractiveButtonReplyContent(string buttonId = default, string title = default) { - return new AcsMessageInteractiveButtonReplyContent(buttonId, title, serializedAdditionalRawData: null); + return new AcsMessageInteractiveButtonReplyContent(buttonId, title, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Message Interactive list reply content for a user to business message. /// The ID of the selected list item. /// The title of the selected list item. /// The description of the selected row. /// A new instance for mocking. - public static AcsMessageInteractiveListReplyContent AcsMessageInteractiveListReplyContent(string listItemId = null, string title = null, string description = null) + public static AcsMessageInteractiveListReplyContent AcsMessageInteractiveListReplyContent(string listItemId = default, string title = default, string description = default) { - return new AcsMessageInteractiveListReplyContent(listItemId, title, description, serializedAdditionalRawData: null); + return new AcsMessageInteractiveListReplyContent(listItemId, title, description, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The content of the event request message. /// The event ID. /// The time at which the event occurred. /// The action that encompasses the provided event. @@ -2358,7 +2379,7 @@ public static AcsMessageInteractiveListReplyContent AcsMessageInteractiveListRep /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryEventData ContainerRegistryEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryEventData ContainerRegistryEventData(string id = default, DateTimeOffset? timestamp = default, string action = default, string location = default, ContainerRegistryEventTarget target = default, ContainerRegistryEventRequest request = default, ContainerRegistryEventActor actor = default, ContainerRegistryEventSource source = default, ContainerRegistryEventConnectedRegistry connectedRegistry = default) { return new ContainerRegistryEventData( id, @@ -2370,10 +2391,10 @@ public static ContainerRegistryEventData ContainerRegistryEventData(string id = actor, source, connectedRegistry, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The target of the event. /// The MIME type of the referenced object. /// The number of bytes of the content. Same as Length field. /// The digest of the content, as defined by the Registry V2 HTTP API Specification. @@ -2382,7 +2403,7 @@ public static ContainerRegistryEventData ContainerRegistryEventData(string id = /// The direct URL to the content. /// The tag name. /// A new instance for mocking. - public static ContainerRegistryEventTarget ContainerRegistryEventTarget(string mediaType = null, long? size = null, string digest = null, long? length = null, string repository = null, string url = null, string tag = null) + public static ContainerRegistryEventTarget ContainerRegistryEventTarget(string mediaType = default, long? size = default, string digest = default, long? length = default, string repository = default, string url = default, string tag = default) { return new ContainerRegistryEventTarget( mediaType, @@ -2392,53 +2413,53 @@ public static ContainerRegistryEventTarget ContainerRegistryEventTarget(string m repository, url, tag, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The request that generated the event. /// The ID of the request that initiated the event. /// The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. /// The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. /// The request method that generated the event. /// The user agent header of the request. /// A new instance for mocking. - public static ContainerRegistryEventRequest ContainerRegistryEventRequest(string id = null, string addr = null, string host = null, string method = null, string useragent = null) + public static ContainerRegistryEventRequest ContainerRegistryEventRequest(string id = default, string addr = default, string host = default, string @method = default, string useragent = default) { return new ContainerRegistryEventRequest( id, addr, host, - method, + @method, useragent, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The subject or username associated with the request context that generated the event. /// A new instance for mocking. - public static ContainerRegistryEventActor ContainerRegistryEventActor(string name = null) + public static ContainerRegistryEventActor ContainerRegistryEventActor(string name = default) { - return new ContainerRegistryEventActor(name, serializedAdditionalRawData: null); + return new ContainerRegistryEventActor(name, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. /// The running instance of an application. Changes after each restart. /// A new instance for mocking. - public static ContainerRegistryEventSource ContainerRegistryEventSource(string addr = null, string instanceID = null) + public static ContainerRegistryEventSource ContainerRegistryEventSource(string addr = default, string instanceID = default) { - return new ContainerRegistryEventSource(addr, instanceID, serializedAdditionalRawData: null); + return new ContainerRegistryEventSource(addr, instanceID, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The connected registry information if the event is generated by a connected registry. /// The name of the connected registry that generated this event. /// A new instance for mocking. - public static ContainerRegistryEventConnectedRegistry ContainerRegistryEventConnectedRegistry(string name = null) + public static ContainerRegistryEventConnectedRegistry ContainerRegistryEventConnectedRegistry(string name = default) { - return new ContainerRegistryEventConnectedRegistry(name, serializedAdditionalRawData: null); + return new ContainerRegistryEventConnectedRegistry(name, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event. /// The event ID. /// The time at which the event occurred. /// The action that encompasses the provided event. @@ -2449,7 +2470,7 @@ public static ContainerRegistryEventConnectedRegistry ContainerRegistryEventConn /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = default, DateTimeOffset? timestamp = default, string action = default, string location = default, ContainerRegistryEventTarget target = default, ContainerRegistryEventRequest request = default, ContainerRegistryEventActor actor = default, ContainerRegistryEventSource source = default, ContainerRegistryEventConnectedRegistry connectedRegistry = default) { return new ContainerRegistryImagePushedEventData( id, @@ -2461,10 +2482,10 @@ public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushed actor, source, connectedRegistry, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event. /// The event ID. /// The time at which the event occurred. /// The action that encompasses the provided event. @@ -2475,7 +2496,7 @@ public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushed /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = default, DateTimeOffset? timestamp = default, string action = default, string location = default, ContainerRegistryEventTarget target = default, ContainerRegistryEventRequest request = default, ContainerRegistryEventActor actor = default, ContainerRegistryEventSource source = default, ContainerRegistryEventConnectedRegistry connectedRegistry = default) { return new ContainerRegistryImageDeletedEventData( id, @@ -2487,10 +2508,10 @@ public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDelet actor, source, connectedRegistry, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The content of the event request message. /// The event ID. /// The time at which the event occurred. /// The action that encompasses the provided event. @@ -2498,7 +2519,7 @@ public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDelet /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = default, DateTimeOffset? timestamp = default, string action = default, string location = default, ContainerRegistryArtifactEventTarget target = default, ContainerRegistryEventConnectedRegistry connectedRegistry = default) { return new ContainerRegistryArtifactEventData( id, @@ -2507,10 +2528,10 @@ public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventD location, target, connectedRegistry, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The target of the event. /// The MIME type of the artifact. /// The size in bytes of the artifact. /// The digest of the artifact. @@ -2519,7 +2540,7 @@ public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventD /// The name of the artifact. /// The version of the artifact. /// A new instance for mocking. - public static ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEventTarget(string mediaType = null, long? size = null, string digest = null, string repository = null, string tag = null, string name = null, string version = null) + public static ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEventTarget(string mediaType = default, long? size = default, string digest = default, string repository = default, string tag = default, string name = default, string version = default) { return new ContainerRegistryArtifactEventTarget( mediaType, @@ -2529,10 +2550,10 @@ public static ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEven tag, name, version, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event. /// The event ID. /// The time at which the event occurred. /// The action that encompasses the provided event. @@ -2540,7 +2561,7 @@ public static ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEven /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = default, DateTimeOffset? timestamp = default, string action = default, string location = default, ContainerRegistryArtifactEventTarget target = default, ContainerRegistryEventConnectedRegistry connectedRegistry = default) { return new ContainerRegistryChartPushedEventData( id, @@ -2549,10 +2570,10 @@ public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushed location, target, connectedRegistry, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event. /// The event ID. /// The time at which the event occurred. /// The action that encompasses the provided event. @@ -2560,7 +2581,7 @@ public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushed /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = default, DateTimeOffset? timestamp = default, string action = default, string location = default, ContainerRegistryArtifactEventTarget target = default, ContainerRegistryEventConnectedRegistry connectedRegistry = default) { return new ContainerRegistryChartDeletedEventData( id, @@ -2569,107 +2590,107 @@ public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDelet location, target, connectedRegistry, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event. /// The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource. /// The highest PATCH Kubernetes version for the MINOR version considered stable for the ManagedCluster resource. /// The highest PATCH Kubernetes version for the lowest applicable MINOR version available for the ManagedCluster resource. /// The highest PATCH Kubernetes version considered preview for the ManagedCluster resource. There might not be any version in preview at the time of publishing the event. /// A new instance for mocking. - public static ContainerServiceNewKubernetesVersionAvailableEventData ContainerServiceNewKubernetesVersionAvailableEventData(string latestSupportedKubernetesVersion = null, string latestStableKubernetesVersion = null, string lowestMinorKubernetesVersion = null, string latestPreviewKubernetesVersion = null) + public static ContainerServiceNewKubernetesVersionAvailableEventData ContainerServiceNewKubernetesVersionAvailableEventData(string latestSupportedKubernetesVersion = default, string latestStableKubernetesVersion = default, string lowestMinorKubernetesVersion = default, string latestPreviewKubernetesVersion = default) { - return new ContainerServiceNewKubernetesVersionAvailableEventData(latestSupportedKubernetesVersion, latestStableKubernetesVersion, lowestMinorKubernetesVersion, latestPreviewKubernetesVersion, serializedAdditionalRawData: null); + return new ContainerServiceNewKubernetesVersionAvailableEventData(latestSupportedKubernetesVersion, latestStableKubernetesVersion, lowestMinorKubernetesVersion, latestPreviewKubernetesVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of cluster support events. /// The Kubernetes version of the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceClusterSupportEventData ContainerServiceClusterSupportEventData(string kubernetesVersion = null) + public static ContainerServiceClusterSupportEventData ContainerServiceClusterSupportEventData(string kubernetesVersion = default) { - return new ContainerServiceClusterSupportEventData(kubernetesVersion, serializedAdditionalRawData: null); + return new ContainerServiceClusterSupportEventData(kubernetesVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.ClusterSupportEnded event. /// The Kubernetes version of the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceClusterSupportEndedEventData ContainerServiceClusterSupportEndedEventData(string kubernetesVersion = null) + public static ContainerServiceClusterSupportEndedEventData ContainerServiceClusterSupportEndedEventData(string kubernetesVersion = default) { - return new ContainerServiceClusterSupportEndedEventData(kubernetesVersion, serializedAdditionalRawData: null); + return new ContainerServiceClusterSupportEndedEventData(kubernetesVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.ClusterSupportEnding event. /// The Kubernetes version of the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceClusterSupportEndingEventData ContainerServiceClusterSupportEndingEventData(string kubernetesVersion = null) + public static ContainerServiceClusterSupportEndingEventData ContainerServiceClusterSupportEndingEventData(string kubernetesVersion = default) { - return new ContainerServiceClusterSupportEndingEventData(kubernetesVersion, serializedAdditionalRawData: null); + return new ContainerServiceClusterSupportEndingEventData(kubernetesVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of common properties of node pool rolling events. /// The name of the node pool in the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceNodePoolRollingEventData ContainerServiceNodePoolRollingEventData(string nodePoolName = null) + public static ContainerServiceNodePoolRollingEventData ContainerServiceNodePoolRollingEventData(string nodePoolName = default) { - return new ContainerServiceNodePoolRollingEventData(nodePoolName, serializedAdditionalRawData: null); + return new ContainerServiceNodePoolRollingEventData(nodePoolName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingStarted event. /// The name of the node pool in the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceNodePoolRollingStartedEventData ContainerServiceNodePoolRollingStartedEventData(string nodePoolName = null) + public static ContainerServiceNodePoolRollingStartedEventData ContainerServiceNodePoolRollingStartedEventData(string nodePoolName = default) { - return new ContainerServiceNodePoolRollingStartedEventData(nodePoolName, serializedAdditionalRawData: null); + return new ContainerServiceNodePoolRollingStartedEventData(nodePoolName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingSucceeded event. /// The name of the node pool in the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceNodePoolRollingSucceededEventData ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName = null) + public static ContainerServiceNodePoolRollingSucceededEventData ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName = default) { - return new ContainerServiceNodePoolRollingSucceededEventData(nodePoolName, serializedAdditionalRawData: null); + return new ContainerServiceNodePoolRollingSucceededEventData(nodePoolName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingFailed event. /// The name of the node pool in the ManagedCluster resource. /// A new instance for mocking. - public static ContainerServiceNodePoolRollingFailedEventData ContainerServiceNodePoolRollingFailedEventData(string nodePoolName = null) + public static ContainerServiceNodePoolRollingFailedEventData ContainerServiceNodePoolRollingFailedEventData(string nodePoolName = default) { - return new ContainerServiceNodePoolRollingFailedEventData(nodePoolName, serializedAdditionalRawData: null); + return new ContainerServiceNodePoolRollingFailedEventData(nodePoolName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyStarted event. /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) + public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = default, DataBoxStageName? stageName = default, DateTimeOffset? stageTime = default) { - return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); + return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event. /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) + public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = default, DataBoxStageName? stageName = default, DateTimeOffset? stageTime = default) { - return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); + return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.OrderCompleted event. /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) + public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = default, DataBoxStageName? stageName = default, DateTimeOffset? stageTime = default) { - return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); + return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Edge.SolutionVersionPublished event. /// A GUID to uniquely track External Solution Validation. /// ARM ID of the Target resource. /// ARM ID of the Solution Template resource. @@ -2678,7 +2699,7 @@ public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(stri /// API Version supported for the resources. /// Direct URL to callback for updating validation status. /// A new instance for mocking. - public static EdgeSolutionVersionPublishedEventData EdgeSolutionVersionPublishedEventData(string externalValidationId = null, string targetId = null, string solutionTemplateId = null, string solutionTemplateVersionId = null, string solutionVersionId = null, string apiVersion = null, Uri callbackUrl = null) + public static EdgeSolutionVersionPublishedEventData EdgeSolutionVersionPublishedEventData(string externalValidationId = default, string targetId = default, string solutionTemplateId = default, string solutionTemplateVersionId = default, string solutionVersionId = default, string apiVersion = default, Uri callbackUrl = default) { return new EdgeSolutionVersionPublishedEventData( externalValidationId, @@ -2688,10 +2709,10 @@ public static EdgeSolutionVersionPublishedEventData EdgeSolutionVersionPublished solutionVersionId, apiVersion, callbackUrl, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event. /// The path to the capture file. /// The file type of the capture file. /// The shard ID. @@ -2702,7 +2723,7 @@ public static EdgeSolutionVersionPublishedEventData EdgeSolutionVersionPublished /// The first time from the queue. /// The last time from the queue. /// A new instance for mocking. - public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = null, int? eventCount = null, int? firstSequenceNumber = null, int? lastSequenceNumber = null, DateTimeOffset? firstEnqueueTime = null, DateTimeOffset? lastEnqueueTime = null) + public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = default, string fileType = default, string partitionId = default, int? sizeInBytes = default, int? eventCount = default, int? firstSequenceNumber = default, int? lastSequenceNumber = default, DateTimeOffset? firstEnqueueTime = default, DateTimeOffset? lastEnqueueTime = default) { return new EventHubCaptureFileCreatedEventData( fileurl, @@ -2714,25 +2735,25 @@ public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEven lastSequenceNumber, firstEnqueueTime, lastEnqueueTime, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult). /// Lists of the geometry ID of the geofence which is expired relative to the user time in the request. /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. /// A new instance for mocking. - public static MapsGeofenceEventProperties MapsGeofenceEventProperties(IEnumerable expiredGeofenceGeometryId = null, IEnumerable geometries = null, IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = null) + public static MapsGeofenceEventProperties MapsGeofenceEventProperties(IEnumerable expiredGeofenceGeometryId = default, IEnumerable geometries = default, IEnumerable invalidPeriodGeofenceGeometryId = default, bool? isEventPublished = default) { - expiredGeofenceGeometryId ??= new List(); - geometries ??= new List(); - invalidPeriodGeofenceGeometryId ??= new List(); + expiredGeofenceGeometryId ??= new ChangeTrackingList(); + geometries ??= new ChangeTrackingList(); + invalidPeriodGeofenceGeometryId ??= new ChangeTrackingList(); - return new MapsGeofenceEventProperties(expiredGeofenceGeometryId?.ToList(), geometries?.ToList(), invalidPeriodGeofenceGeometryId?.ToList(), isEventPublished, serializedAdditionalRawData: null); + return new MapsGeofenceEventProperties(expiredGeofenceGeometryId.ToList(), geometries.ToList(), invalidPeriodGeofenceGeometryId.ToList(), isEventPublished, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The geofence geometry. /// ID of the device. /// Distance from the coordinate to the closest border of the geofence. Positive means the coordinate is outside of the geofence. If the coordinate is outside of the geofence, but more than the value of searchBuffer away from the closest geofence border, then the value is 999. Negative means the coordinate is inside of the geofence. If the coordinate is inside the polygon, but more than the value of searchBuffer away from the closest geofencing border,then the value is -999. A value of 999 means that there is great confidence the coordinate is well outside the geofence. A value of -999 means that there is great confidence the coordinate is well within the geofence. /// The unique ID for the geofence geometry. @@ -2740,7 +2761,7 @@ public static MapsGeofenceEventProperties MapsGeofenceEventProperties(IEnumerabl /// Longitude of the nearest point of the geometry. /// The unique id returned from user upload service when uploading a geofence. Will not be included in geofencing post API. /// A new instance for mocking. - public static MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = null, float? distance = null, string geometryId = null, float? nearestLat = null, float? nearestLon = null, string udId = null) + public static MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = default, float? distance = default, string geometryId = default, float? nearestLat = default, float? nearestLon = default, string udId = default) { return new MapsGeofenceGeometry( deviceId, @@ -2749,65 +2770,65 @@ public static MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = null, nearestLat, nearestLon, udId, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event. /// Lists of the geometry ID of the geofence which is expired relative to the user time in the request. /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. /// A new instance for mocking. - public static MapsGeofenceEnteredEventData MapsGeofenceEnteredEventData(IEnumerable expiredGeofenceGeometryId = null, IEnumerable geometries = null, IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = null) + public static MapsGeofenceEnteredEventData MapsGeofenceEnteredEventData(IEnumerable expiredGeofenceGeometryId = default, IEnumerable geometries = default, IEnumerable invalidPeriodGeofenceGeometryId = default, bool? isEventPublished = default) { - expiredGeofenceGeometryId ??= new List(); - geometries ??= new List(); - invalidPeriodGeofenceGeometryId ??= new List(); + expiredGeofenceGeometryId ??= new ChangeTrackingList(); + geometries ??= new ChangeTrackingList(); + invalidPeriodGeofenceGeometryId ??= new ChangeTrackingList(); - return new MapsGeofenceEnteredEventData(expiredGeofenceGeometryId?.ToList(), geometries?.ToList(), invalidPeriodGeofenceGeometryId?.ToList(), isEventPublished, serializedAdditionalRawData: null); + return new MapsGeofenceEnteredEventData(expiredGeofenceGeometryId.ToList(), geometries.ToList(), invalidPeriodGeofenceGeometryId.ToList(), isEventPublished, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceExited event. /// Lists of the geometry ID of the geofence which is expired relative to the user time in the request. /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. /// A new instance for mocking. - public static MapsGeofenceExitedEventData MapsGeofenceExitedEventData(IEnumerable expiredGeofenceGeometryId = null, IEnumerable geometries = null, IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = null) + public static MapsGeofenceExitedEventData MapsGeofenceExitedEventData(IEnumerable expiredGeofenceGeometryId = default, IEnumerable geometries = default, IEnumerable invalidPeriodGeofenceGeometryId = default, bool? isEventPublished = default) { - expiredGeofenceGeometryId ??= new List(); - geometries ??= new List(); - invalidPeriodGeofenceGeometryId ??= new List(); + expiredGeofenceGeometryId ??= new ChangeTrackingList(); + geometries ??= new ChangeTrackingList(); + invalidPeriodGeofenceGeometryId ??= new ChangeTrackingList(); - return new MapsGeofenceExitedEventData(expiredGeofenceGeometryId?.ToList(), geometries?.ToList(), invalidPeriodGeofenceGeometryId?.ToList(), isEventPublished, serializedAdditionalRawData: null); + return new MapsGeofenceExitedEventData(expiredGeofenceGeometryId.ToList(), geometries.ToList(), invalidPeriodGeofenceGeometryId.ToList(), isEventPublished, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceResult event. /// Lists of the geometry ID of the geofence which is expired relative to the user time in the request. /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. /// A new instance for mocking. - public static MapsGeofenceResultEventData MapsGeofenceResultEventData(IEnumerable expiredGeofenceGeometryId = null, IEnumerable geometries = null, IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = null) + public static MapsGeofenceResultEventData MapsGeofenceResultEventData(IEnumerable expiredGeofenceGeometryId = default, IEnumerable geometries = default, IEnumerable invalidPeriodGeofenceGeometryId = default, bool? isEventPublished = default) { - expiredGeofenceGeometryId ??= new List(); - geometries ??= new List(); - invalidPeriodGeofenceGeometryId ??= new List(); + expiredGeofenceGeometryId ??= new ChangeTrackingList(); + geometries ??= new ChangeTrackingList(); + invalidPeriodGeofenceGeometryId ??= new ChangeTrackingList(); - return new MapsGeofenceResultEventData(expiredGeofenceGeometryId?.ToList(), geometries?.ToList(), invalidPeriodGeofenceGeometryId?.ToList(), isEventPublished, serializedAdditionalRawData: null); + return new MapsGeofenceResultEventData(expiredGeofenceGeometryId.ToList(), geometries.ToList(), invalidPeriodGeofenceGeometryId.ToList(), isEventPublished, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted). /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. /// A new instance for mocking. - public static DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(string deviceId = null, string hubName = null, DeviceTwinInfo twin = null) + public static DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(string deviceId = default, string hubName = default, DeviceTwinInfo twin = default) { - return new DeviceLifeCycleEventProperties(deviceId, hubName, twin, serializedAdditionalRawData: null); + return new DeviceLifeCycleEventProperties(deviceId, hubName, twin, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information about the device twin, which is the cloud representation of application device metadata. /// Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority. /// Count of cloud to device messages sent to this device. /// Whether the device is connected or disconnected. @@ -2820,7 +2841,7 @@ public static DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(stri /// An integer that is incremented by one each time the device twin is updated. /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. /// A new instance for mocking. - public static DeviceTwinInfo DeviceTwinInfo(string authenticationType = null, float? cloudToDeviceMessageCount = null, string connectionState = null, string deviceId = null, string etag = null, string lastActivityTime = null, DeviceTwinInfoProperties properties = null, string status = null, string statusUpdateTime = null, float? version = null, DeviceTwinInfoX509Thumbprint x509Thumbprint = null) + public static DeviceTwinInfo DeviceTwinInfo(string authenticationType = default, float? cloudToDeviceMessageCount = default, string connectionState = default, string deviceId = default, string etag = default, string lastActivityTime = default, DeviceTwinInfoProperties properties = default, string status = default, string statusUpdateTime = default, float? version = default, DeviceTwinInfoX509Thumbprint x509Thumbprint = default) { return new DeviceTwinInfo( authenticationType, @@ -2834,165 +2855,165 @@ public static DeviceTwinInfo DeviceTwinInfo(string authenticationType = null, fl statusUpdateTime, version, x509Thumbprint, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Properties JSON element. /// A portion of the properties that can be written only by the application back-end, and read by the device. /// A portion of the properties that can be written only by the device, and read by the application back-end. /// A new instance for mocking. - public static DeviceTwinInfoProperties DeviceTwinInfoProperties(DeviceTwinProperties desired = null, DeviceTwinProperties reported = null) + public static DeviceTwinInfoProperties DeviceTwinInfoProperties(DeviceTwinProperties desired = default, DeviceTwinProperties reported = default) { - return new DeviceTwinInfoProperties(desired, reported, serializedAdditionalRawData: null); + return new DeviceTwinInfoProperties(desired, reported, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A portion of the properties that can be written only by the application back-end, and read by the device. /// Metadata information for the properties JSON document. /// Version of device twin properties. /// A new instance for mocking. - public static DeviceTwinProperties DeviceTwinProperties(DeviceTwinMetadata metadata = null, float? version = null) + public static DeviceTwinProperties DeviceTwinProperties(DeviceTwinMetadata metadata = default, float? version = default) { - return new DeviceTwinProperties(metadata, version, serializedAdditionalRawData: null); + return new DeviceTwinProperties(metadata, version, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Metadata information for the properties JSON document. /// The ISO8601 timestamp of the last time the properties were updated. /// A new instance for mocking. - public static DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = null) + public static DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = default) { - return new DeviceTwinMetadata(lastUpdated, serializedAdditionalRawData: null); + return new DeviceTwinMetadata(lastUpdated, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate. /// Primary thumbprint for the x509 certificate. /// Secondary thumbprint for the x509 certificate. /// A new instance for mocking. - public static DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = null, string secondaryThumbprint = null) + public static DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = default, string secondaryThumbprint = default) { - return new DeviceTwinInfoX509Thumbprint(primaryThumbprint, secondaryThumbprint, serializedAdditionalRawData: null); + return new DeviceTwinInfoX509Thumbprint(primaryThumbprint, secondaryThumbprint, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected). /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. /// A new instance for mocking. - public static DeviceConnectionStateEventProperties DeviceConnectionStateEventProperties(string deviceId = null, string moduleId = null, string hubName = null, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) + public static DeviceConnectionStateEventProperties DeviceConnectionStateEventProperties(string deviceId = default, string moduleId = default, string hubName = default, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = default) { - return new DeviceConnectionStateEventProperties(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData: null); + return new DeviceConnectionStateEventProperties(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Information about the device connection state event. /// Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number. /// A new instance for mocking. - public static DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(string sequenceNumber = null) + public static DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(string sequenceNumber = default) { - return new DeviceConnectionStateEventInfo(sequenceNumber, serializedAdditionalRawData: null); + return new DeviceConnectionStateEventInfo(sequenceNumber, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry). /// The content of the message from the device. /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. /// A new instance for mocking. - public static DeviceTelemetryEventProperties DeviceTelemetryEventProperties(object body = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary systemProperties = null) + public static DeviceTelemetryEventProperties DeviceTelemetryEventProperties(object body = default, IDictionary properties = default, IDictionary systemProperties = default) { - properties ??= new Dictionary(); - systemProperties ??= new Dictionary(); + properties ??= new ChangeTrackingDictionary(); + systemProperties ??= new ChangeTrackingDictionary(); - return new DeviceTelemetryEventProperties(body, properties, systemProperties, serializedAdditionalRawData: null); + return new DeviceTelemetryEventProperties(body, properties, systemProperties, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.Devices.DeviceCreated event. /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. /// A new instance for mocking. - public static IotHubDeviceCreatedEventData IotHubDeviceCreatedEventData(string deviceId = null, string hubName = null, DeviceTwinInfo twin = null) + public static IotHubDeviceCreatedEventData IotHubDeviceCreatedEventData(string deviceId = default, string hubName = default, DeviceTwinInfo twin = default) { - return new IotHubDeviceCreatedEventData(deviceId, hubName, twin, serializedAdditionalRawData: null); + return new IotHubDeviceCreatedEventData(deviceId, hubName, twin, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.Devices.DeviceDeleted event. /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. /// A new instance for mocking. - public static IotHubDeviceDeletedEventData IotHubDeviceDeletedEventData(string deviceId = null, string hubName = null, DeviceTwinInfo twin = null) + public static IotHubDeviceDeletedEventData IotHubDeviceDeletedEventData(string deviceId = default, string hubName = default, DeviceTwinInfo twin = default) { - return new IotHubDeviceDeletedEventData(deviceId, hubName, twin, serializedAdditionalRawData: null); + return new IotHubDeviceDeletedEventData(deviceId, hubName, twin, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.Devices.DeviceConnected event. /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. /// A new instance for mocking. - public static IotHubDeviceConnectedEventData IotHubDeviceConnectedEventData(string deviceId = null, string moduleId = null, string hubName = null, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) + public static IotHubDeviceConnectedEventData IotHubDeviceConnectedEventData(string deviceId = default, string moduleId = default, string hubName = default, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = default) { - return new IotHubDeviceConnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData: null); + return new IotHubDeviceConnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.Devices.DeviceDisconnected event. /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. /// A new instance for mocking. - public static IotHubDeviceDisconnectedEventData IotHubDeviceDisconnectedEventData(string deviceId = null, string moduleId = null, string hubName = null, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) + public static IotHubDeviceDisconnectedEventData IotHubDeviceDisconnectedEventData(string deviceId = default, string moduleId = default, string hubName = default, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = default) { - return new IotHubDeviceDisconnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData: null); + return new IotHubDeviceDisconnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.Devices.DeviceTelemetry event. /// The content of the message from the device. /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. /// A new instance for mocking. - public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(object body = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary systemProperties = null) + public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(object body = default, IDictionary properties = default, IDictionary systemProperties = default) { - properties ??= new Dictionary(); - systemProperties ??= new Dictionary(); + properties ??= new ChangeTrackingDictionary(); + systemProperties ??= new ChangeTrackingDictionary(); - return new IotHubDeviceTelemetryEventData(body, properties, systemProperties, serializedAdditionalRawData: null); + return new IotHubDeviceTelemetryEventData(body, properties, systemProperties, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event. /// Type of HL7 FHIR resource. /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType = default, string fhirServiceHostName = default, string fhirResourceId = default, long? fhirResourceVersionId = default) { - return new HealthcareFhirResourceCreatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); + return new HealthcareFhirResourceCreatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event. /// Type of HL7 FHIR resource. /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType = default, string fhirServiceHostName = default, string fhirResourceId = default, long? fhirResourceVersionId = default) { - return new HealthcareFhirResourceUpdatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); + return new HealthcareFhirResourceUpdatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event. /// Type of HL7 FHIR resource. /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType = default, string fhirServiceHostName = default, string fhirResourceId = default, long? fhirResourceVersionId = default) { - return new HealthcareFhirResourceDeletedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); + return new HealthcareFhirResourceDeletedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event. /// Data partition name. /// Unique identifier for the Study. /// Unique identifier for the Series. @@ -3000,7 +3021,7 @@ public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDelet /// Domain name of the DICOM account for this image. /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service. /// A new instance for mocking. - public static HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = null) + public static HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string partitionName = default, string imageStudyInstanceUid = default, string imageSeriesInstanceUid = default, string imageSopInstanceUid = default, string serviceHostName = default, long? sequenceNumber = default) { return new HealthcareDicomImageCreatedEventData( partitionName, @@ -3009,10 +3030,10 @@ public static HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEv imageSopInstanceUid, serviceHostName, sequenceNumber, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event. /// Data partition name. /// Unique identifier for the Study. /// Unique identifier for the Series. @@ -3020,7 +3041,7 @@ public static HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEv /// Host name of the DICOM account for this image. /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service. /// A new instance for mocking. - public static HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = null) + public static HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEventData(string partitionName = default, string imageStudyInstanceUid = default, string imageSeriesInstanceUid = default, string imageSopInstanceUid = default, string serviceHostName = default, long? sequenceNumber = default) { return new HealthcareDicomImageDeletedEventData( partitionName, @@ -3029,10 +3050,10 @@ public static HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEv imageSopInstanceUid, serviceHostName, sequenceNumber, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageUpdated event. /// Data partition name. /// Unique identifier for the Study. /// Unique identifier for the Series. @@ -3040,7 +3061,7 @@ public static HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEv /// Domain name of the DICOM account for this image. /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation, updation and deletion within the service. /// A new instance for mocking. - public static HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = null) + public static HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEventData(string partitionName = default, string imageStudyInstanceUid = default, string imageSeriesInstanceUid = default, string imageSopInstanceUid = default, string serviceHostName = default, long? sequenceNumber = default) { return new HealthcareDicomImageUpdatedEventData( partitionName, @@ -3049,10 +3070,10 @@ public static HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEv imageSopInstanceUid, serviceHostName, sequenceNumber, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3061,7 +3082,7 @@ public static HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEv /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultCertificateNewVersionCreatedEventData KeyVaultCertificateNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultCertificateNewVersionCreatedEventData KeyVaultCertificateNewVersionCreatedEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultCertificateNewVersionCreatedEventData( id, @@ -3071,10 +3092,10 @@ public static KeyVaultCertificateNewVersionCreatedEventData KeyVaultCertificateN version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3083,7 +3104,7 @@ public static KeyVaultCertificateNewVersionCreatedEventData KeyVaultCertificateN /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultCertificateNearExpiryEventData KeyVaultCertificateNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultCertificateNearExpiryEventData KeyVaultCertificateNearExpiryEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultCertificateNearExpiryEventData( id, @@ -3093,10 +3114,10 @@ public static KeyVaultCertificateNearExpiryEventData KeyVaultCertificateNearExpi version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3105,7 +3126,7 @@ public static KeyVaultCertificateNearExpiryEventData KeyVaultCertificateNearExpi /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultCertificateExpiredEventData KeyVaultCertificateExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultCertificateExpiredEventData KeyVaultCertificateExpiredEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultCertificateExpiredEventData( id, @@ -3115,10 +3136,10 @@ public static KeyVaultCertificateExpiredEventData KeyVaultCertificateExpiredEven version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3127,7 +3148,7 @@ public static KeyVaultCertificateExpiredEventData KeyVaultCertificateExpiredEven /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultKeyNewVersionCreatedEventData KeyVaultKeyNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultKeyNewVersionCreatedEventData KeyVaultKeyNewVersionCreatedEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultKeyNewVersionCreatedEventData( id, @@ -3137,10 +3158,10 @@ public static KeyVaultKeyNewVersionCreatedEventData KeyVaultKeyNewVersionCreated version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3149,7 +3170,7 @@ public static KeyVaultKeyNewVersionCreatedEventData KeyVaultKeyNewVersionCreated /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultKeyNearExpiryEventData KeyVaultKeyNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultKeyNearExpiryEventData KeyVaultKeyNearExpiryEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultKeyNearExpiryEventData( id, @@ -3159,10 +3180,10 @@ public static KeyVaultKeyNearExpiryEventData KeyVaultKeyNearExpiryEventData(stri version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3171,7 +3192,7 @@ public static KeyVaultKeyNearExpiryEventData KeyVaultKeyNearExpiryEventData(stri /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultKeyExpiredEventData KeyVaultKeyExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultKeyExpiredEventData KeyVaultKeyExpiredEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultKeyExpiredEventData( id, @@ -3181,10 +3202,10 @@ public static KeyVaultKeyExpiredEventData KeyVaultKeyExpiredEventData(string id version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3193,7 +3214,7 @@ public static KeyVaultKeyExpiredEventData KeyVaultKeyExpiredEventData(string id /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionCreatedEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultSecretNewVersionCreatedEventData( id, @@ -3203,10 +3224,10 @@ public static KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionC version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3215,7 +3236,7 @@ public static KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionC /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultSecretNearExpiryEventData( id, @@ -3225,10 +3246,10 @@ public static KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventDat version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3237,7 +3258,7 @@ public static KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventDat /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultSecretExpiredEventData( id, @@ -3247,10 +3268,10 @@ public static KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(stri version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event. /// The id of the object that triggered this event. /// Key vault name of the object that triggered this event. /// The type of the object that triggered this event. @@ -3259,7 +3280,7 @@ public static KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(stri /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. /// A new instance for mocking. - public static KeyVaultAccessPolicyChangedEventData KeyVaultAccessPolicyChangedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = null, float? exp = null) + public static KeyVaultAccessPolicyChangedEventData KeyVaultAccessPolicyChangedEventData(string id = default, string vaultName = default, string objectType = default, string objectName = default, string version = default, float? nbf = default, float? exp = default) { return new KeyVaultAccessPolicyChangedEventData( id, @@ -3269,28 +3290,28 @@ public static KeyVaultAccessPolicyChangedEventData KeyVaultAccessPolicyChangedEv version, nbf, exp, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event. /// The name of the model that was registered. /// The version of the model that was registered. /// The tags of the model that was registered. /// The properties of the model that was registered. /// A new instance for mocking. - public static MachineLearningServicesModelRegisteredEventData MachineLearningServicesModelRegisteredEventData(string modelName = null, string modelVersion = null, object modelTags = null, object modelProperties = null) + public static MachineLearningServicesModelRegisteredEventData MachineLearningServicesModelRegisteredEventData(string modelName = default, string modelVersion = default, object modelTags = default, object modelProperties = default) { - return new MachineLearningServicesModelRegisteredEventData(modelName, modelVersion, modelTags, modelProperties, serializedAdditionalRawData: null); + return new MachineLearningServicesModelRegisteredEventData(modelName, modelVersion, modelTags, modelProperties, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event. /// The name of the deployed service. /// The compute type (e.g. ACI, AKS) of the deployed service. /// A common separated list of model IDs. The IDs of the models deployed in the service. /// The tags of the deployed service. /// The properties of the deployed service. /// A new instance for mocking. - public static MachineLearningServicesModelDeployedEventData MachineLearningServicesModelDeployedEventData(string serviceName = null, string serviceComputeType = null, string modelIds = null, object serviceTags = null, object serviceProperties = null) + public static MachineLearningServicesModelDeployedEventData MachineLearningServicesModelDeployedEventData(string serviceName = default, string serviceComputeType = default, string modelIds = default, object serviceTags = default, object serviceProperties = default) { return new MachineLearningServicesModelDeployedEventData( serviceName, @@ -3298,10 +3319,10 @@ public static MachineLearningServicesModelDeployedEventData MachineLearningServi modelIds, serviceTags, serviceProperties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event. /// The ID of the experiment that the run belongs to. /// The name of the experiment that the run belongs to. /// The ID of the Run that was completed. @@ -3309,7 +3330,7 @@ public static MachineLearningServicesModelDeployedEventData MachineLearningServi /// The tags of the completed Run. /// The properties of the completed Run. /// A new instance for mocking. - public static MachineLearningServicesRunCompletedEventData MachineLearningServicesRunCompletedEventData(string experimentId = null, string experimentName = null, string runId = null, string runType = null, object runTags = null, object runProperties = null) + public static MachineLearningServicesRunCompletedEventData MachineLearningServicesRunCompletedEventData(string experimentId = default, string experimentName = default, string runId = default, string runType = default, object runTags = default, object runProperties = default) { return new MachineLearningServicesRunCompletedEventData( experimentId, @@ -3318,10 +3339,10 @@ public static MachineLearningServicesRunCompletedEventData MachineLearningServic runType, runTags, runProperties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event. /// The ID of the data drift monitor that triggered the event. /// The name of the data drift monitor that triggered the event. /// The ID of the Run that detected data drift. @@ -3331,7 +3352,7 @@ public static MachineLearningServicesRunCompletedEventData MachineLearningServic /// The start time of the target dataset time series that resulted in drift detection. /// The end time of the target dataset time series that resulted in drift detection. /// A new instance for mocking. - public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = null, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null) + public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = default, string dataDriftName = default, string runId = default, string baseDatasetId = default, string targetDatasetId = default, double? driftCoefficient = default, DateTimeOffset? startTime = default, DateTimeOffset? endTime = default) { return new MachineLearningServicesDatasetDriftDetectedEventData( dataDriftId, @@ -3342,10 +3363,10 @@ public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearni driftCoefficient, startTime, endTime, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event. /// The ID of the experiment that the Machine Learning Run belongs to. /// The name of the experiment that the Machine Learning Run belongs to. /// The ID of the Machine Learning Run. @@ -3354,7 +3375,7 @@ public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearni /// The properties of the Machine Learning Run. /// The status of the Machine Learning Run. /// A new instance for mocking. - public static MachineLearningServicesRunStatusChangedEventData MachineLearningServicesRunStatusChangedEventData(string experimentId = null, string experimentName = null, string runId = null, string runType = null, object runTags = null, object runProperties = null, string runStatus = null) + public static MachineLearningServicesRunStatusChangedEventData MachineLearningServicesRunStatusChangedEventData(string experimentId = default, string experimentName = default, string runId = default, string runType = default, object runTags = default, object runProperties = default, string runStatus = default) { return new MachineLearningServicesRunStatusChangedEventData( experimentId, @@ -3364,10 +3385,10 @@ public static MachineLearningServicesRunStatusChangedEventData MachineLearningSe runTags, runProperties, runStatus, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event. /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. /// The resource ID of the policy assignment. /// The resource ID of the policy definition. @@ -3376,7 +3397,7 @@ public static MachineLearningServicesRunStatusChangedEventData MachineLearningSe /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp = default, string policyAssignmentId = default, string policyDefinitionId = default, string policyDefinitionReferenceId = default, string complianceState = default, string subscriptionId = default, string complianceReasonCode = default) { return new PolicyInsightsPolicyStateCreatedEventData( timestamp, @@ -3386,10 +3407,10 @@ public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStat complianceState, subscriptionId, complianceReasonCode, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event. /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. /// The resource ID of the policy assignment. /// The resource ID of the policy definition. @@ -3398,7 +3419,7 @@ public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStat /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp = default, string policyAssignmentId = default, string policyDefinitionId = default, string policyDefinitionReferenceId = default, string complianceState = default, string subscriptionId = default, string complianceReasonCode = default) { return new PolicyInsightsPolicyStateChangedEventData( timestamp, @@ -3408,10 +3429,10 @@ public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStat complianceState, subscriptionId, complianceReasonCode, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event. /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. /// The resource ID of the policy assignment. /// The resource ID of the policy definition. @@ -3420,7 +3441,7 @@ public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStat /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp = default, string policyAssignmentId = default, string policyDefinitionId = default, string policyDefinitionReferenceId = default, string complianceState = default, string subscriptionId = default, string complianceReasonCode = default) { return new PolicyInsightsPolicyStateDeletedEventData( timestamp, @@ -3430,62 +3451,73 @@ public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStat complianceState, subscriptionId, complianceReasonCode, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event. /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) + public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset? timestamp = default, string name = default, string status = default) { - return new RedisPatchingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisPatchingCompletedEventData(timestamp, name, status, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event. /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) + public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset? timestamp = default, string name = default, string status = default) { - return new RedisScalingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisScalingCompletedEventData(timestamp, name, status, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) + public static RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(DateTimeOffset? timestamp = default, string name = default, string status = default) { - return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisExportRdbCompletedEventData(timestamp, name, status, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) + public static RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(DateTimeOffset? timestamp = default, string name = default, string status = default) { - return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisImportRdbCompletedEventData(timestamp, name, status, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The details of the authorization for the resource. /// The scope of the authorization. /// The action being requested. /// The evidence for the authorization. /// A new instance for mocking. - public static ResourceAuthorization ResourceAuthorization(string scope = null, string action = null, IReadOnlyDictionary evidence = null) + public static ResourceAuthorization ResourceAuthorization(string scope = default, string action = default, IDictionary evidence = default) { - evidence ??= new Dictionary(); + evidence ??= new ChangeTrackingDictionary(); - return new ResourceAuthorization(scope, action, evidence, serializedAdditionalRawData: null); + return new ResourceAuthorization(scope, action, evidence, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The details of the HTTP request. + /// The client request ID. + /// The client IP address. + /// + /// The url used in the request. + /// A new instance for mocking. + public static ResourceHttpRequest ResourceHttpRequest(string clientRequestId = default, string clientIpAddress = default, string methodString = default, string url = default) + { + return new ResourceHttpRequest(clientRequestId, clientIpAddress, methodString, url, additionalBinaryDataProperties: null); + } + + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. /// The namespace name of the Microsoft.ServiceBus resource. /// The endpoint of the Microsoft.ServiceBus resource. /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. @@ -3493,7 +3525,7 @@ public static ResourceAuthorization ResourceAuthorization(string scope = null, s /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. /// A new instance for mocking. - public static ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) + public static ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = default, string requestUri = default, string entityType = default, string queueName = default, string topicName = default, string subscriptionName = default) { return new ServiceBusActiveMessagesAvailableWithNoListenersEventData( namespaceName, @@ -3502,10 +3534,10 @@ public static ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceB queueName, topicName, subscriptionName, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event. /// The namespace name of the Microsoft.ServiceBus resource. /// The endpoint of the Microsoft.ServiceBus resource. /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. @@ -3513,7 +3545,7 @@ public static ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceB /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. /// A new instance for mocking. - public static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) + public static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName = default, string requestUri = default, string entityType = default, string queueName = default, string topicName = default, string subscriptionName = default) { return new ServiceBusDeadletterMessagesAvailableWithNoListenersEventData( namespaceName, @@ -3522,10 +3554,10 @@ public static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData Serv queueName, topicName, subscriptionName, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event. /// The namespace name of the Microsoft.ServiceBus resource. /// The endpoint of the Microsoft.ServiceBus resource. /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. @@ -3533,7 +3565,7 @@ public static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData Serv /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. /// A new instance for mocking. - public static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) + public static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string namespaceName = default, string requestUri = default, string entityType = default, string queueName = default, string topicName = default, string subscriptionName = default) { return new ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData( namespaceName, @@ -3542,10 +3574,10 @@ public static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData Se queueName, topicName, subscriptionName, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event. /// The namespace name of the Microsoft.ServiceBus resource. /// The endpoint of the Microsoft.ServiceBus resource. /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. @@ -3553,7 +3585,7 @@ public static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData Se /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. /// A new instance for mocking. - public static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) + public static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName = default, string requestUri = default, string entityType = default, string queueName = default, string topicName = default, string subscriptionName = default) { return new ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData( namespaceName, @@ -3562,28 +3594,28 @@ public static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDat queueName, topicName, subscriptionName, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event. /// The time at which the event occurred. /// The hub of connected client connection. /// The connection Id of connected client connection. /// The user Id of connected client connection. /// A new instance for mocking. - public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null) + public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp = default, string hubName = default, string connectionId = default, string userId = default) { - return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, serializedAdditionalRawData: null); + return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event. /// The time at which the event occurred. /// The hub of connected client connection. /// The connection Id of connected client connection. /// The user Id of connected client connection. /// The message of error that cause the client connection disconnected. /// A new instance for mocking. - public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) + public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp = default, string hubName = default, string connectionId = default, string userId = default, string errorMessage = default) { return new SignalRServiceClientConnectionDisconnectedEventData( timestamp, @@ -3591,10 +3623,10 @@ public static SignalRServiceClientConnectionDisconnectedEventData SignalRService connectionId, userId, errorMessage, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3609,7 +3641,7 @@ public static SignalRServiceClientConnectionDisconnectedEventData SignalRService /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, StorageBlobAccessTier accessTier = default, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = default, string clientRequestId = default, string requestId = default, string eTag = default, string contentType = default, long? contentLength = default, long? contentOffset = default, string blobType = default, StorageBlobAccessTier accessTier = default, string url = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageBlobCreatedEventData( api, @@ -3625,10 +3657,10 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3639,7 +3671,7 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobDeletedEventData StorageBlobDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobDeletedEventData StorageBlobDeletedEventData(string api = default, string clientRequestId = default, string requestId = default, string contentType = default, string blobType = default, string url = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageBlobDeletedEventData( api, @@ -3651,10 +3683,10 @@ public static StorageBlobDeletedEventData StorageBlobDeletedEventData(string api sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3664,7 +3696,7 @@ public static StorageBlobDeletedEventData StorageBlobDeletedEventData(string api /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = default, string clientRequestId = default, string requestId = default, string eTag = default, string url = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageDirectoryCreatedEventData( api, @@ -3675,10 +3707,34 @@ public static StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData( sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event. + /// The name of the API/operation that triggered this event. + /// A request id provided by the client of the storage API operation that triggered this event. + /// The request id generated by the storage service for the storage API operation that triggered this event. + /// The path to the deleted directory. + /// + /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. + /// The identity of the requester that triggered this event. + /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + /// A new instance for mocking. + public static StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = default, string clientRequestId = default, string requestId = default, string url = default, string recursiveString = default, string sequencer = default, string identity = default, object storageDiagnostics = default) + { + return new StorageDirectoryDeletedEventData( + api, + clientRequestId, + requestId, + url, + recursiveString, + sequencer, + identity, + storageDiagnostics, + additionalBinaryDataProperties: null); + } + + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3688,7 +3744,7 @@ public static StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData( /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = default, string clientRequestId = default, string requestId = default, string sourceUrl = default, string destinationUrl = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageBlobRenamedEventData( api, @@ -3699,10 +3755,10 @@ public static StorageBlobRenamedEventData StorageBlobRenamedEventData(string api sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3712,7 +3768,7 @@ public static StorageBlobRenamedEventData StorageBlobRenamedEventData(string api /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = default, string clientRequestId = default, string requestId = default, string sourceUrl = default, string destinationUrl = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageDirectoryRenamedEventData( api, @@ -3723,10 +3779,10 @@ public static StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData( sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event. /// The time the policy task was scheduled. /// Policy execution summary which shows the completion status of a LCM run". /// Execution statistics of a specific policy action in a Blob Management cycle. @@ -3734,7 +3790,7 @@ public static StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData( /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// A new instance for mocking. - public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, StorageLifecyclePolicyRunSummary policyRunSummary = null, StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null) + public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = default, StorageLifecyclePolicyRunSummary policyRunSummary = default, StorageLifecyclePolicyActionSummaryDetail deleteSummary = default, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = default, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = default, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = default) { return new StorageLifecyclePolicyCompletedEventData( scheduleTime, @@ -3743,28 +3799,28 @@ public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCom tierToCoolSummary, tierToArchiveSummary, tierToColdSummary, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Policy run status of an account in a Blob Management cycle. /// Policy status can be Completed/CompletedWithError/Incomplete. /// A new instance for mocking. public static StorageLifecyclePolicyRunSummary StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus = default) { - return new StorageLifecyclePolicyRunSummary(completionStatus, serializedAdditionalRawData: null); + return new StorageLifecyclePolicyRunSummary(completionStatus, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Execution statistics of a specific policy action in a Blob Management cycle. /// Total number of objects to be acted on by this action. /// Number of success operations of this action. /// Error messages of this action if any. /// A new instance for mocking. - public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = null, long? successCount = null, string errorList = null) + public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default, long? successCount = default, string errorList = default) { - return new StorageLifecyclePolicyActionSummaryDetail(totalObjectsCount, successCount, errorList, serializedAdditionalRawData: null); + return new StorageLifecyclePolicyActionSummaryDetail(totalObjectsCount, successCount, errorList, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3778,7 +3834,7 @@ public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyAc /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, StorageBlobAccessTier accessTier = default, StorageBlobAccessTier previousTier = default, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = default, string clientRequestId = default, string requestId = default, string contentType = default, long? contentLength = default, string blobType = default, StorageBlobAccessTier accessTier = default, StorageBlobAccessTier previousTier = default, string url = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageBlobTierChangedEventData( api, @@ -3793,10 +3849,10 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. @@ -3808,7 +3864,7 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(string api = default, string clientRequestId = default, string requestId = default, string contentType = default, long? contentLength = default, string blobType = default, string url = default, string sequencer = default, string identity = default, object storageDiagnostics = default) { return new StorageAsyncOperationInitiatedEventData( api, @@ -3821,10 +3877,10 @@ public static StorageAsyncOperationInitiatedEventData StorageAsyncOperationIniti sequencer, identity, storageDiagnostics, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event. /// The time at which inventory policy was scheduled. /// The account name for which inventory policy is registered. /// The rule name for inventory policy. @@ -3833,7 +3889,7 @@ public static StorageAsyncOperationInitiatedEventData StorageAsyncOperationIniti /// The policy run id for inventory run. /// The blob URL for manifest file for inventory run. /// A new instance for mocking. - public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime = null, string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) + public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime = default, string accountName = default, string ruleName = default, string policyRunStatus = default, string policyRunStatusMessage = default, string policyRunId = default, string manifestBlobUrl = default) { return new StorageBlobInventoryPolicyCompletedEventData( scheduleDateTime, @@ -3843,17 +3899,17 @@ public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryP policyRunStatusMessage, policyRunId, manifestBlobUrl, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskCompleted event. /// The status for a storage task. /// The time at which a storage task was completed. /// The execution id for a storage task. /// The task name for a storage task. /// The summary report blob url for a storage task. /// A new instance for mocking. - public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus? status = null, DateTimeOffset? completedDateTime = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) + public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus? status = default, DateTimeOffset? completedDateTime = default, string taskExecutionId = default, string taskName = default, Uri summaryReportBlobUri = default) { return new StorageTaskCompletedEventData( status, @@ -3861,35 +3917,35 @@ public static StorageTaskCompletedEventData StorageTaskCompletedEventData(Storag taskExecutionId, taskName, summaryReportBlobUri, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskQueued event. /// The time at which a storage task was queued. /// The execution id for a storage task. /// A new instance for mocking. - public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime = null, string taskExecutionId = null) + public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime = default, string taskExecutionId = default) { - return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, serializedAdditionalRawData: null); + return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskAssignmentQueued event. /// The time at which a storage task was queued. /// The execution id for a storage task. /// A new instance for mocking. - public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn = null, string taskExecutionId = null) + public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn = default, string taskExecutionId = default) { - return new StorageTaskAssignmentQueuedEventData(queuedOn, taskExecutionId, serializedAdditionalRawData: null); + return new StorageTaskAssignmentQueuedEventData(queuedOn, taskExecutionId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskAssignmentCompleted event. /// The status for a storage task. /// The time at which a storage task was completed. /// The execution id for a storage task. /// The task name for a storage task. /// The summary report blob url for a storage task. /// A new instance for mocking. - public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status = null, DateTimeOffset? completedOn = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) + public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status = default, DateTimeOffset? completedOn = default, string taskExecutionId = default, string taskName = default, Uri summaryReportBlobUri = default) { return new StorageTaskAssignmentCompletedEventData( status, @@ -3897,18 +3953,18 @@ public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompl taskExecutionId, taskName, summaryReportBlobUri, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Detail of action on the app. /// Type of action of the operation. /// A new instance for mocking. - public static AppEventTypeDetail AppEventTypeDetail(AppAction? action = null) + public static AppEventTypeDetail AppEventTypeDetail(AppAction? action = default) { - return new AppEventTypeDetail(action, serializedAdditionalRawData: null); + return new AppEventTypeDetail(action, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -3917,7 +3973,7 @@ public static AppEventTypeDetail AppEventTypeDetail(AppAction? action = null) /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebAppUpdatedEventData WebAppUpdatedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebAppUpdatedEventData WebAppUpdatedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebAppUpdatedEventData( appEventTypeDetail, @@ -3927,10 +3983,10 @@ public static WebAppUpdatedEventData WebAppUpdatedEventData(AppEventTypeDetail a requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -3939,7 +3995,7 @@ public static WebAppUpdatedEventData WebAppUpdatedEventData(AppEventTypeDetail a /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebBackupOperationStartedEventData WebBackupOperationStartedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebBackupOperationStartedEventData WebBackupOperationStartedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebBackupOperationStartedEventData( appEventTypeDetail, @@ -3949,10 +4005,10 @@ public static WebBackupOperationStartedEventData WebBackupOperationStartedEventD requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -3961,7 +4017,7 @@ public static WebBackupOperationStartedEventData WebBackupOperationStartedEventD /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebBackupOperationCompletedEventData WebBackupOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebBackupOperationCompletedEventData WebBackupOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebBackupOperationCompletedEventData( appEventTypeDetail, @@ -3971,10 +4027,10 @@ public static WebBackupOperationCompletedEventData WebBackupOperationCompletedEv requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -3983,7 +4039,7 @@ public static WebBackupOperationCompletedEventData WebBackupOperationCompletedEv /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebBackupOperationFailedEventData WebBackupOperationFailedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebBackupOperationFailedEventData WebBackupOperationFailedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebBackupOperationFailedEventData( appEventTypeDetail, @@ -3993,10 +4049,10 @@ public static WebBackupOperationFailedEventData WebBackupOperationFailedEventDat requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4005,7 +4061,7 @@ public static WebBackupOperationFailedEventData WebBackupOperationFailedEventDat /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebRestoreOperationStartedEventData WebRestoreOperationStartedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebRestoreOperationStartedEventData WebRestoreOperationStartedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebRestoreOperationStartedEventData( appEventTypeDetail, @@ -4015,10 +4071,10 @@ public static WebRestoreOperationStartedEventData WebRestoreOperationStartedEven requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4027,7 +4083,7 @@ public static WebRestoreOperationStartedEventData WebRestoreOperationStartedEven /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebRestoreOperationCompletedEventData WebRestoreOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebRestoreOperationCompletedEventData WebRestoreOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebRestoreOperationCompletedEventData( appEventTypeDetail, @@ -4037,10 +4093,10 @@ public static WebRestoreOperationCompletedEventData WebRestoreOperationCompleted requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4049,7 +4105,7 @@ public static WebRestoreOperationCompletedEventData WebRestoreOperationCompleted /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebRestoreOperationFailedEventData WebRestoreOperationFailedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebRestoreOperationFailedEventData WebRestoreOperationFailedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebRestoreOperationFailedEventData( appEventTypeDetail, @@ -4059,10 +4115,10 @@ public static WebRestoreOperationFailedEventData WebRestoreOperationFailedEventD requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4071,7 +4127,7 @@ public static WebRestoreOperationFailedEventData WebRestoreOperationFailedEventD /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebSlotSwapStartedEventData WebSlotSwapStartedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebSlotSwapStartedEventData WebSlotSwapStartedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebSlotSwapStartedEventData( appEventTypeDetail, @@ -4081,10 +4137,10 @@ public static WebSlotSwapStartedEventData WebSlotSwapStartedEventData(AppEventTy requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4093,7 +4149,7 @@ public static WebSlotSwapStartedEventData WebSlotSwapStartedEventData(AppEventTy /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebSlotSwapCompletedEventData WebSlotSwapCompletedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebSlotSwapCompletedEventData WebSlotSwapCompletedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebSlotSwapCompletedEventData( appEventTypeDetail, @@ -4103,10 +4159,10 @@ public static WebSlotSwapCompletedEventData WebSlotSwapCompletedEventData(AppEve requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4115,7 +4171,7 @@ public static WebSlotSwapCompletedEventData WebSlotSwapCompletedEventData(AppEve /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebSlotSwapFailedEventData WebSlotSwapFailedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebSlotSwapFailedEventData WebSlotSwapFailedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebSlotSwapFailedEventData( appEventTypeDetail, @@ -4125,10 +4181,10 @@ public static WebSlotSwapFailedEventData WebSlotSwapFailedEventData(AppEventType requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4137,7 +4193,7 @@ public static WebSlotSwapFailedEventData WebSlotSwapFailedEventData(AppEventType /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebSlotSwapWithPreviewStartedEventData WebSlotSwapWithPreviewStartedEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebSlotSwapWithPreviewStartedEventData WebSlotSwapWithPreviewStartedEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebSlotSwapWithPreviewStartedEventData( appEventTypeDetail, @@ -4147,10 +4203,10 @@ public static WebSlotSwapWithPreviewStartedEventData WebSlotSwapWithPreviewStart requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event. /// Detail of action on the app. /// name of the web site that had this event. /// The client request id generated by the app service for the site API operation that triggered this event. @@ -4159,7 +4215,7 @@ public static WebSlotSwapWithPreviewStartedEventData WebSlotSwapWithPreviewStart /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebSlotSwapWithPreviewCancelledEventData WebSlotSwapWithPreviewCancelledEventData(AppEventTypeDetail appEventTypeDetail = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebSlotSwapWithPreviewCancelledEventData WebSlotSwapWithPreviewCancelledEventData(AppEventTypeDetail appEventTypeDetail = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebSlotSwapWithPreviewCancelledEventData( appEventTypeDetail, @@ -4169,10 +4225,10 @@ public static WebSlotSwapWithPreviewCancelledEventData WebSlotSwapWithPreviewCan requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event. /// Detail of action on the app service plan. /// sku of app service plan. /// name of the app service plan that had this event. @@ -4182,7 +4238,7 @@ public static WebSlotSwapWithPreviewCancelledEventData WebSlotSwapWithPreviewCan /// HTTP request URL of this operation. /// HTTP verb of this operation. /// A new instance for mocking. - public static WebAppServicePlanUpdatedEventData WebAppServicePlanUpdatedEventData(AppServicePlanEventTypeDetail appServicePlanEventTypeDetail = null, WebAppServicePlanUpdatedEventDataSku sku = null, string name = null, string clientRequestId = null, string correlationRequestId = null, string requestId = null, string address = null, string verb = null) + public static WebAppServicePlanUpdatedEventData WebAppServicePlanUpdatedEventData(AppServicePlanEventTypeDetail appServicePlanEventTypeDetail = default, WebAppServicePlanUpdatedEventDataSku sku = default, string name = default, string clientRequestId = default, string correlationRequestId = default, string requestId = default, string address = default, string verb = default) { return new WebAppServicePlanUpdatedEventData( appServicePlanEventTypeDetail, @@ -4193,27 +4249,27 @@ public static WebAppServicePlanUpdatedEventData WebAppServicePlanUpdatedEventDat requestId, address, verb, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Detail of action on the app service plan. /// Kind of environment where app service plan is. /// Type of action on the app service plan. /// Asynchronous operation status of the operation on the app service plan. /// A new instance for mocking. - public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind? stampKind = null, AppServicePlanAction? action = null, AsyncStatus? status = null) + public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind? stampKind = default, AppServicePlanAction? action = default, AsyncStatus? status = default) { - return new AppServicePlanEventTypeDetail(stampKind, action, status, serializedAdditionalRawData: null); + return new AppServicePlanEventTypeDetail(stampKind, action, status, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// sku of app service plan. /// name of app service plan sku. /// tier of app service plan sku. /// size of app service plan sku. /// family of app service plan sku. /// capacity of app service plan sku. /// A new instance for mocking. - public static WebAppServicePlanUpdatedEventDataSku WebAppServicePlanUpdatedEventDataSku(string name = null, string tier = null, string size = null, string family = null, string capacity = null) + public static WebAppServicePlanUpdatedEventDataSku WebAppServicePlanUpdatedEventDataSku(string name = default, string tier = default, string size = default, string family = default, string capacity = default) { return new WebAppServicePlanUpdatedEventDataSku( name, @@ -4221,10 +4277,10 @@ public static WebAppServicePlanUpdatedEventDataSku WebAppServicePlanUpdatedEvent size, family, capacity, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event. /// /// The validation code sent by Azure Event Grid to validate an event subscription. /// To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, @@ -4236,20 +4292,23 @@ public static WebAppServicePlanUpdatedEventDataSku WebAppServicePlanUpdatedEvent /// or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). /// /// A new instance for mocking. - public static SubscriptionValidationEventData SubscriptionValidationEventData(string validationCode = null, string validationUrl = null) + public static SubscriptionValidationEventData SubscriptionValidationEventData(string validationCode = default, string validationUrl = default) { - return new SubscriptionValidationEventData(validationCode, validationUrl, serializedAdditionalRawData: null); + return new SubscriptionValidationEventData(validationCode, validationUrl, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.EventGrid.SubscriptionDeletedEvent event. + /// /// The Azure resource ID of the deleted event subscription. /// A new instance for mocking. - public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string eventSubscriptionId = null) + public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string eventSubscriptionId = default) { - return new SubscriptionDeletedEventData(eventSubscriptionId, serializedAdditionalRawData: null); + return new SubscriptionDeletedEventData(eventSubscriptionId, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4258,12 +4317,12 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. /// A new instance for mocking. - public static EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + public static EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default) { - return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.EventGrid.MQTTClientCreatedOrUpdated event. /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4280,22 +4339,22 @@ public static EventGridMqttClientEventData EventGridMqttClientEventData(string c /// /// The key-value attributes that are assigned to the client resource. /// A new instance for mocking. - public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, EventGridMqttClientState? state = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, IReadOnlyDictionary attributes = null) + public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default, EventGridMqttClientState? state = default, DateTimeOffset? createdOn = default, DateTimeOffset? updatedOn = default, IDictionary attributes = default) { - attributes ??= new Dictionary(); + attributes ??= new ChangeTrackingDictionary(); return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, state, createdOn, updatedOn, attributes); } - /// Initializes a new instance of . + /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4304,12 +4363,12 @@ public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCr /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. /// A new instance for mocking. - public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default) { - return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Event data for Microsoft.EventGrid.MQTTClientSessionConnected event. /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4327,18 +4386,18 @@ public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEven /// than the previous event. /// /// A new instance for mocking. - public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) + public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default, string clientSessionName = default, long? sequenceNumber = default) { return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, clientSessionName, sequenceNumber); } - /// Initializes a new instance of . + /// Event data for Microsoft.EventGrid.MQTTClientSessionDisconnected event. /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4360,40 +4419,43 @@ public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSe /// one of the values in the disconnection reasons table. /// /// A new instance for mocking. - public static EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null, EventGridMqttClientDisconnectionReason? disconnectionReason = null) + public static EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default, string clientSessionName = default, long? sequenceNumber = default, EventGridMqttClientDisconnectionReason? disconnectionReason = default) { return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, clientSessionName, sequenceNumber, disconnectionReason); } - /// Initializes a new instance of . + /// Describes the schema of the common properties across all ARN system topic events. /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. /// A new instance for mocking. - public static ResourceNotificationsResourceUpdatedEventData ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + public static ResourceNotificationsResourceUpdatedEventData ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default, string apiVersion = default) { - return new ResourceNotificationsResourceUpdatedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceUpdatedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Describes the schema of the properties under resource info which are common + /// across all ARN system topic events + /// /// id of the resource for which the event is being emitted. /// name of the resource for which the event is being emitted. /// the type of the resource for which the event is being emitted. /// the location of the resource for which the event is being emitted. /// the tags on the resource for which the event is being emitted. - /// properties in the payload of the resource for which the event is being emitted. + /// The properties of the resource for which the event is being emitted. /// A new instance for mocking. - public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = null, string name = null, string resourceType = null, string location = null, IReadOnlyDictionary resourceTags = null, IReadOnlyDictionary properties = null) + public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = default, string name = default, string resourceType = default, string location = default, IReadOnlyDictionary resourceTags = default, IReadOnlyDictionary properties = default) { - resourceTags ??= new Dictionary(); - properties ??= new Dictionary(); + resourceTags ??= new ChangeTrackingDictionary(); + properties ??= new ChangeTrackingDictionary(); return new ResourceNotificationsResourceUpdatedDetails( id, @@ -4402,73 +4464,102 @@ public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsR location, resourceTags, properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// details of operational info. /// Date and Time when resource was updated. /// A new instance for mocking. - public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime = null) + public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime = default) { - return new ResourceNotificationsOperationalDetails(resourceEventTime, serializedAdditionalRawData: null); + return new ResourceNotificationsOperationalDetails(resourceEventTime, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged + /// event. + /// /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. /// A new instance for mocking. - public static ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + public static ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default, string apiVersion = default) { - return new ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + return new ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated event. + /// /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. /// A new instance for mocking. - public static ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + public static ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default, string apiVersion = default) + { + return new ResourceNotificationsHealthResourcesAnnotatedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties: null); + } + + /// + /// Describes the schema of the properties under resource info which are common + /// across all ARN system topic delete events + /// + /// Resource for which the event is being emitted. + /// + /// + /// A new instance for mocking. + public static ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(ResourceIdentifier resource = default, string name = default, string @type = default) { - return new ResourceNotificationsHealthResourcesAnnotatedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceDeletedDetails(resource, name, @type, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Describes the schema of the common properties across all ARN system topic + /// delete events + /// /// resourceInfo details for delete event. /// details about operational info. /// A new instance for mocking. - public static ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null) + public static ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default) { - return new ResourceNotificationsResourceDeletedEventData(resourceDetails, operationalDetails, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceDeletedEventData(resourceDetails, operationalDetails, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.Resources.CreatedOrUpdated event. + /// /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. /// A new instance for mocking. - public static ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + public static ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default, string apiVersion = default) { - return new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.Resources.Deleted event. + /// /// resourceInfo details for delete event. /// details about operational info. /// A new instance for mocking. - public static ResourceNotificationsResourceManagementDeletedEventData ResourceNotificationsResourceManagementDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null) + public static ResourceNotificationsResourceManagementDeletedEventData ResourceNotificationsResourceManagementDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default) { - return new ResourceNotificationsResourceManagementDeletedEventData(resourceDetails, operationalDetails, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceManagementDeletedEventData(resourceDetails, operationalDetails, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event.Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event. /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. /// A new instance for mocking. - public static ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + public static ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = default, ResourceNotificationsOperationalDetails operationalDetails = default, string apiVersion = default) { - return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties: null); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs index 8a191c76cbe9..2762addd18fa 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.EventGrid.MQTTClientCreatedOrUpdated event. [JsonConverter(typeof(EventGridMqttClientCreatedOrUpdatedEventDataConverter))] - public partial class EventGridMqttClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientCreatedOrUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(State)) { @@ -57,115 +61,133 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri foreach (var item in Attributes) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - EventGridMqttClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EventGridMqttClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (EventGridMqttClientCreatedOrUpdatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } - internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGridMqttClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGridMqttClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - EventGridMqttClientState? state = default; - DateTimeOffset? createdOn = default; - DateTimeOffset? updatedOn = default; - IReadOnlyDictionary attributes = default; string clientAuthenticationName = default; string clientName = default; string namespaceName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + EventGridMqttClientState? state = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? updatedOn = default; + IDictionary attributes = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("state"u8)) + if (prop.NameEquals("clientAuthenticationName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + clientAuthenticationName = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("clientName"u8)) + { + clientName = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("namespaceName"u8)) + { + namespaceName = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("state"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - state = new EventGridMqttClientState(property.Value.GetString()); + state = new EventGridMqttClientState(prop.Value.GetString()); continue; } - if (property.NameEquals("createdOn"u8)) + if (prop.NameEquals("createdOn"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - createdOn = property.Value.GetDateTimeOffset("O"); + createdOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("updatedOn"u8)) + if (prop.NameEquals("updatedOn"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - updatedOn = property.Value.GetDateTimeOffset("O"); + updatedOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("attributes"u8)) + if (prop.NameEquals("attributes"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } attributes = dictionary; continue; } - if (property.NameEquals("clientAuthenticationName"u8)) - { - clientAuthenticationName = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientName"u8)) - { - clientName = property.Value.GetString(); - continue; - } - if (property.NameEquals("namespaceName"u8)) - { - namespaceName = property.Value.GetString(); - continue; - } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, - serializedAdditionalRawData, + additionalBinaryDataProperties, state, createdOn, updatedOn, attributes); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -175,15 +197,20 @@ BinaryData IPersistableModel.Write } } - EventGridMqttClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EventGridMqttClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (EventGridMqttClientCreatedOrUpdatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } default: @@ -191,35 +218,28 @@ EventGridMqttClientCreatedOrUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new EventGridMqttClientCreatedOrUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EventGridMqttClientCreatedOrUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EventGridMqttClientCreatedOrUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EventGridMqttClientCreatedOrUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs index 231496115c60..5a67ae92f1e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs @@ -21,13 +21,8 @@ public partial class EventGridMqttClientCreatedOrUpdatedEventData : EventGridMqt /// /// Name of the Event Grid namespace where the MQTT client was created or updated. /// The key-value attributes that are assigned to the client resource. - /// , or is null. - internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string namespaceName, IReadOnlyDictionary attributes) : base(clientAuthenticationName, namespaceName) + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string namespaceName, IDictionary attributes) : base(clientAuthenticationName, namespaceName) { - Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(attributes, nameof(attributes)); - Attributes = attributes; } @@ -39,7 +34,7 @@ internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticatio /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// Configured state of the client. The value could be Enabled or Disabled. /// Time the client resource is created based on the provider's UTC time. /// @@ -48,7 +43,7 @@ internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticatio /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. - internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties) { State = state; CreatedOn = createdOn; @@ -56,22 +51,20 @@ internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticatio Attributes = attributes; } - /// Initializes a new instance of for deserialization. - internal EventGridMqttClientCreatedOrUpdatedEventData() - { - } - /// Configured state of the client. The value could be Enabled or Disabled. public EventGridMqttClientState? State { get; } + /// Time the client resource is created based on the provider's UTC time. public DateTimeOffset? CreatedOn { get; } + /// /// Time the client resource is last updated based on the provider's UTC time. If /// the client resource was never updated, this value is identical to the value of /// the 'createdOn' property. /// public DateTimeOffset? UpdatedOn { get; } + /// The key-value attributes that are assigned to the client resource. - public IReadOnlyDictionary Attributes { get; } + public IDictionary Attributes { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs index 9f3b49176782..bdb5244b2206 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. [JsonConverter(typeof(EventGridMqttClientDeletedEventDataConverter))] - public partial class EventGridMqttClientDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - EventGridMqttClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EventGridMqttClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (EventGridMqttClientDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } - internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -62,38 +71,39 @@ internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClie string clientAuthenticationName = default; string clientName = default; string namespaceName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("clientAuthenticationName"u8)) + if (prop.NameEquals("clientAuthenticationName"u8)) { - clientAuthenticationName = property.Value.GetString(); + clientAuthenticationName = prop.Value.GetString(); continue; } - if (property.NameEquals("clientName"u8)) + if (prop.NameEquals("clientName"u8)) { - clientName = property.Value.GetString(); + clientName = prop.Value.GetString(); continue; } - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - namespaceName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +113,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - EventGridMqttClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EventGridMqttClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (EventGridMqttClientDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } default: @@ -119,35 +134,28 @@ EventGridMqttClientDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new EventGridMqttClientDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEventGridMqttClientDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EventGridMqttClientDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EventGridMqttClientDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EventGridMqttClientDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMqttClientDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs index 11e73e9db9bb..ad7b43544563 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs @@ -20,11 +20,8 @@ public partial class EventGridMqttClientDeletedEventData : EventGridMqttClientEv /// long, and supports UTF-8 characters. /// /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// or is null. internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string namespaceName) : base(clientAuthenticationName, namespaceName) { - Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); } /// Initializes a new instance of . @@ -35,13 +32,8 @@ internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, st /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// Keeps track of any properties unknown to the library. - internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal EventGridMqttClientDeletedEventData() + /// Keeps track of any properties unknown to the library. + internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties) : base(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs index ff0734d417e4..7f890e7a5d31 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs @@ -14,63 +14,99 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct EventGridMqttClientDisconnectionReason : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EventGridMqttClientDisconnectionReason(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The client got disconnected for any authentication reasons (for example, certificate expired, client got disabled, or client configuration changed). private const string ClientAuthenticationErrorValue = "ClientAuthenticationError"; + /// The client got disconnected for any authorization reasons (for example, because of a change in the configuration of topic spaces, permission bindings, or client groups). private const string ClientAuthorizationErrorValue = "ClientAuthorizationError"; + /// The client sent a bad request or used one of the unsupported features that resulted in a connection termination by the service. private const string ClientErrorValue = "ClientError"; + /// The client initiated a graceful disconnect through a DISCONNECT packet for MQTT or a close frame for MQTT over WebSocket. private const string ClientInitiatedDisconnectValue = "ClientInitiatedDisconnect"; + /// The client-server connection is lost. (EXCHANGE ONLINE PROTECTION). private const string ConnectionLostValue = "ConnectionLost"; - private const string IPForbiddenValue = "IpForbidden"; + /// The client's IP address is blocked by IP filter or Private links configuration. + private const string IpForbiddenValue = "IpForbidden"; + /// The client exceeded one or more of the throttling limits that resulted in a connection termination by the service. private const string QuotaExceededValue = "QuotaExceeded"; + /// The connection got terminated due to an unexpected server error. private const string ServerErrorValue = "ServerError"; + /// The server initiates a graceful disconnect for any operational reason. private const string ServerInitiatedDisconnectValue = "ServerInitiatedDisconnect"; + /// The client's queue for unacknowledged QoS1 messages reached its limit, which resulted in a connection termination by the server. private const string SessionOverflowValue = "SessionOverflow"; + /// The client reconnected with the same authentication name, which resulted in the termination of the previous connection. private const string SessionTakenOverValue = "SessionTakenOver"; + /// Initializes a new instance of . + /// The value. + /// is null. + public EventGridMqttClientDisconnectionReason(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The client got disconnected for any authentication reasons (for example, certificate expired, client got disabled, or client configuration changed). public static EventGridMqttClientDisconnectionReason ClientAuthenticationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthenticationErrorValue); + /// The client got disconnected for any authorization reasons (for example, because of a change in the configuration of topic spaces, permission bindings, or client groups). public static EventGridMqttClientDisconnectionReason ClientAuthorizationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthorizationErrorValue); + /// The client sent a bad request or used one of the unsupported features that resulted in a connection termination by the service. public static EventGridMqttClientDisconnectionReason ClientError { get; } = new EventGridMqttClientDisconnectionReason(ClientErrorValue); + /// The client initiated a graceful disconnect through a DISCONNECT packet for MQTT or a close frame for MQTT over WebSocket. public static EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ClientInitiatedDisconnectValue); + /// The client-server connection is lost. (EXCHANGE ONLINE PROTECTION). public static EventGridMqttClientDisconnectionReason ConnectionLost { get; } = new EventGridMqttClientDisconnectionReason(ConnectionLostValue); + /// The client exceeded one or more of the throttling limits that resulted in a connection termination by the service. public static EventGridMqttClientDisconnectionReason QuotaExceeded { get; } = new EventGridMqttClientDisconnectionReason(QuotaExceededValue); + /// The connection got terminated due to an unexpected server error. public static EventGridMqttClientDisconnectionReason ServerError { get; } = new EventGridMqttClientDisconnectionReason(ServerErrorValue); + /// The server initiates a graceful disconnect for any operational reason. public static EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ServerInitiatedDisconnectValue); + /// The client's queue for unacknowledged QoS1 messages reached its limit, which resulted in a connection termination by the server. public static EventGridMqttClientDisconnectionReason SessionOverflow { get; } = new EventGridMqttClientDisconnectionReason(SessionOverflowValue); + /// The client reconnected with the same authentication name, which resulted in the termination of the previous connection. public static EventGridMqttClientDisconnectionReason SessionTakenOver { get; } = new EventGridMqttClientDisconnectionReason(SessionTakenOverValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator EventGridMqttClientDisconnectionReason(string value) => new EventGridMqttClientDisconnectionReason(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator EventGridMqttClientDisconnectionReason?(string value) => value == null ? null : new EventGridMqttClientDisconnectionReason(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is EventGridMqttClientDisconnectionReason other && Equals(other); - /// + + /// public bool Equals(EventGridMqttClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs index 71ff6347a899..79f3a1a396e5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. [JsonConverter(typeof(EventGridMqttClientEventDataConverter))] - public partial class EventGridMqttClientEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("clientAuthenticationName"u8); writer.WriteStringValue(ClientAuthenticationName); if (Optional.IsDefined(ClientName)) @@ -45,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("namespaceName"u8); writer.WriteStringValue(NamespaceName); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -62,22 +66,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EventGridMqttClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EventGridMqttClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual EventGridMqttClientEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEventGridMqttClientEventData(document.RootElement, options); } - internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -85,38 +94,39 @@ internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEvent string clientAuthenticationName = default; string clientName = default; string namespaceName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("clientAuthenticationName"u8)) + if (prop.NameEquals("clientAuthenticationName"u8)) { - clientAuthenticationName = property.Value.GetString(); + clientAuthenticationName = prop.Value.GetString(); continue; } - if (property.NameEquals("clientName"u8)) + if (prop.NameEquals("clientName"u8)) { - clientName = property.Value.GetString(); + clientName = prop.Value.GetString(); continue; } - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - namespaceName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -126,15 +136,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - EventGridMqttClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EventGridMqttClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual EventGridMqttClientEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEventGridMqttClientEventData(document.RootElement, options); } default: @@ -142,35 +157,28 @@ EventGridMqttClientEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static EventGridMqttClientEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEventGridMqttClientEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EventGridMqttClientEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EventGridMqttClientEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EventGridMqttClientEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMqttClientEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs index 02029062d9dd..f8f598bda29e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. public partial class EventGridMqttClientEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// @@ -52,12 +23,8 @@ public partial class EventGridMqttClientEventData /// long, and supports UTF-8 characters. /// /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// or is null. internal EventGridMqttClientEventData(string clientAuthenticationName, string namespaceName) { - Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - ClientAuthenticationName = clientAuthenticationName; NamespaceName = namespaceName; } @@ -70,18 +37,13 @@ internal EventGridMqttClientEventData(string clientAuthenticationName, string na /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// Keeps track of any properties unknown to the library. - internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties) { ClientAuthenticationName = clientAuthenticationName; ClientName = clientName; NamespaceName = namespaceName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal EventGridMqttClientEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// @@ -90,8 +52,10 @@ internal EventGridMqttClientEventData() /// long, and supports UTF-8 characters. /// public string ClientAuthenticationName { get; } + /// Name of the client resource in the Event Grid namespace. public string ClientName { get; } + /// Name of the Event Grid namespace where the MQTT client was created or updated. public string NamespaceName { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs index 1b6d8aa83ac7..a8958f80e538 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.EventGrid.MQTTClientSessionConnected event. [JsonConverter(typeof(EventGridMqttClientSessionConnectedEventDataConverter))] - public partial class EventGridMqttClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionConnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientSessionConnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("clientSessionName"u8); writer.WriteStringValue(ClientSessionName); @@ -46,83 +50,89 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - EventGridMqttClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EventGridMqttClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (EventGridMqttClientSessionConnectedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } - internal static EventGridMqttClientSessionConnectedEventData DeserializeEventGridMqttClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EventGridMqttClientSessionConnectedEventData DeserializeEventGridMqttClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string clientSessionName = default; - long? sequenceNumber = default; string clientAuthenticationName = default; string clientName = default; string namespaceName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string clientSessionName = default; + long? sequenceNumber = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("clientSessionName"u8)) + if (prop.NameEquals("clientAuthenticationName"u8)) { - clientSessionName = property.Value.GetString(); + clientAuthenticationName = prop.Value.GetString(); continue; } - if (property.NameEquals("sequenceNumber"u8)) + if (prop.NameEquals("clientName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sequenceNumber = property.Value.GetInt64(); + clientName = prop.Value.GetString(); continue; } - if (property.NameEquals("clientAuthenticationName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - clientAuthenticationName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } - if (property.NameEquals("clientName"u8)) + if (prop.NameEquals("clientSessionName"u8)) { - clientName = property.Value.GetString(); + clientSessionName = prop.Value.GetString(); continue; } - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("sequenceNumber"u8)) { - namespaceName = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, - serializedAdditionalRawData, + additionalBinaryDataProperties, clientSessionName, sequenceNumber); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -132,15 +142,20 @@ BinaryData IPersistableModel.Write } } - EventGridMqttClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EventGridMqttClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (EventGridMqttClientSessionConnectedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } default: @@ -148,35 +163,28 @@ EventGridMqttClientSessionConnectedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new EventGridMqttClientSessionConnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EventGridMqttClientSessionConnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EventGridMqttClientSessionConnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EventGridMqttClientSessionConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs index ab84d5aa7884..9488d7e6dd69 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs @@ -24,13 +24,8 @@ public partial class EventGridMqttClientSessionConnectedEventData : EventGridMqt /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. /// - /// , or is null. internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName, string namespaceName, string clientSessionName) : base(clientAuthenticationName, namespaceName) { - Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(clientSessionName, nameof(clientSessionName)); - ClientSessionName = clientSessionName; } @@ -42,7 +37,7 @@ internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticatio /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. @@ -52,22 +47,18 @@ internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticatio /// disconnected events. Latest event will have a sequence number that is higher /// than the previous event. /// - internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; } - /// Initializes a new instance of for deserialization. - internal EventGridMqttClientSessionConnectedEventData() - { - } - /// /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. /// public string ClientSessionName { get; } + /// /// A number that helps indicate order of MQTT client session connected or /// disconnected events. Latest event will have a sequence number that is higher diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs index 484324cf1bec..704b33c62d62 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.EventGrid.MQTTClientSessionDisconnected event. [JsonConverter(typeof(EventGridMqttClientSessionDisconnectedEventDataConverter))] - public partial class EventGridMqttClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionDisconnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientSessionDisconnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("clientSessionName"u8); writer.WriteStringValue(ClientSessionName); @@ -51,94 +55,100 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - EventGridMqttClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EventGridMqttClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (EventGridMqttClientSessionDisconnectedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } - internal static EventGridMqttClientSessionDisconnectedEventData DeserializeEventGridMqttClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EventGridMqttClientSessionDisconnectedEventData DeserializeEventGridMqttClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string clientSessionName = default; - long? sequenceNumber = default; - EventGridMqttClientDisconnectionReason? disconnectionReason = default; string clientAuthenticationName = default; string clientName = default; string namespaceName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string clientSessionName = default; + long? sequenceNumber = default; + EventGridMqttClientDisconnectionReason? disconnectionReason = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("clientSessionName"u8)) + if (prop.NameEquals("clientAuthenticationName"u8)) { - clientSessionName = property.Value.GetString(); + clientAuthenticationName = prop.Value.GetString(); continue; } - if (property.NameEquals("sequenceNumber"u8)) + if (prop.NameEquals("clientName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sequenceNumber = property.Value.GetInt64(); + clientName = prop.Value.GetString(); continue; } - if (property.NameEquals("disconnectionReason"u8)) + if (prop.NameEquals("namespaceName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - disconnectionReason = new EventGridMqttClientDisconnectionReason(property.Value.GetString()); + namespaceName = prop.Value.GetString(); continue; } - if (property.NameEquals("clientAuthenticationName"u8)) + if (prop.NameEquals("clientSessionName"u8)) { - clientAuthenticationName = property.Value.GetString(); + clientSessionName = prop.Value.GetString(); continue; } - if (property.NameEquals("clientName"u8)) + if (prop.NameEquals("sequenceNumber"u8)) { - clientName = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = prop.Value.GetInt64(); continue; } - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("disconnectionReason"u8)) { - namespaceName = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disconnectionReason = new EventGridMqttClientDisconnectionReason(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, - serializedAdditionalRawData, + additionalBinaryDataProperties, clientSessionName, sequenceNumber, disconnectionReason); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -148,15 +158,20 @@ BinaryData IPersistableModel.Wr } } - EventGridMqttClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EventGridMqttClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (EventGridMqttClientSessionDisconnectedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override EventGridMqttClientEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } default: @@ -164,35 +179,28 @@ EventGridMqttClientSessionDisconnectedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new EventGridMqttClientSessionDisconnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EventGridMqttClientSessionDisconnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EventGridMqttClientSessionDisconnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EventGridMqttClientSessionDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs index 177a538af454..271d0d579554 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs @@ -24,13 +24,8 @@ public partial class EventGridMqttClientSessionDisconnectedEventData : EventGrid /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. /// - /// , or is null. internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string namespaceName, string clientSessionName) : base(clientAuthenticationName, namespaceName) { - Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(clientSessionName, nameof(clientSessionName)); - ClientSessionName = clientSessionName; } @@ -42,7 +37,7 @@ internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthentica /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. @@ -56,29 +51,26 @@ internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthentica /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber, EventGridMqttClientDisconnectionReason? disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties, string clientSessionName, long? sequenceNumber, EventGridMqttClientDisconnectionReason? disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; DisconnectionReason = disconnectionReason; } - /// Initializes a new instance of for deserialization. - internal EventGridMqttClientSessionDisconnectedEventData() - { - } - /// /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. /// public string ClientSessionName { get; } + /// /// A number that helps indicate order of MQTT client session connected or /// disconnected events. Latest event will have a sequence number that is higher /// than the previous event. /// public long? SequenceNumber { get; } + /// /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs index d12b28d8e9aa..612abf83c7b1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct EventGridMqttClientState : IEquatable { private readonly string _value; + /// Enabled. + private const string EnabledValue = "Enabled"; + /// Disabled. + private const string DisabledValue = "Disabled"; /// Initializes a new instance of . + /// The value. /// is null. public EventGridMqttClientState(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; + _value = value; + } /// Enabled. public static EventGridMqttClientState Enabled { get; } = new EventGridMqttClientState(EnabledValue); + /// Disabled. public static EventGridMqttClientState Disabled { get; } = new EventGridMqttClientState(DisabledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(EventGridMqttClientState left, EventGridMqttClientState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(EventGridMqttClientState left, EventGridMqttClientState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator EventGridMqttClientState(string value) => new EventGridMqttClientState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator EventGridMqttClientState?(string value) => value == null ? null : new EventGridMqttClientState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is EventGridMqttClientState other && Equals(other); - /// + + /// public bool Equals(EventGridMqttClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs index bca6b1827bdc..2f4ce6990159 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event. [JsonConverter(typeof(EventHubCaptureFileCreatedEventDataConverter))] - public partial class EventHubCaptureFileCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventHubCaptureFileCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal EventHubCaptureFileCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventHubCaptureFileCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("fileUrl"u8); writer.WriteStringValue(Fileurl); writer.WritePropertyName("fileType"u8); @@ -72,15 +76,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("lastEnqueueTime"u8); writer.WriteStringValue(LastEnqueueTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -89,27 +93,32 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EventHubCaptureFileCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + EventHubCaptureFileCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual EventHubCaptureFileCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(EventHubCaptureFileCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeEventHubCaptureFileCreatedEventData(document.RootElement, options); } - internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFileCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFileCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string fileUrl = default; + string fileurl = default; string fileType = default; string partitionId = default; int? sizeInBytes = default; @@ -118,87 +127,85 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi int? lastSequenceNumber = default; DateTimeOffset? firstEnqueueTime = default; DateTimeOffset? lastEnqueueTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("fileUrl"u8)) + if (prop.NameEquals("fileUrl"u8)) { - fileUrl = property.Value.GetString(); + fileurl = prop.Value.GetString(); continue; } - if (property.NameEquals("fileType"u8)) + if (prop.NameEquals("fileType"u8)) { - fileType = property.Value.GetString(); + fileType = prop.Value.GetString(); continue; } - if (property.NameEquals("partitionId"u8)) + if (prop.NameEquals("partitionId"u8)) { - partitionId = property.Value.GetString(); + partitionId = prop.Value.GetString(); continue; } - if (property.NameEquals("sizeInBytes"u8)) + if (prop.NameEquals("sizeInBytes"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sizeInBytes = property.Value.GetInt32(); + sizeInBytes = prop.Value.GetInt32(); continue; } - if (property.NameEquals("eventCount"u8)) + if (prop.NameEquals("eventCount"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - eventCount = property.Value.GetInt32(); + eventCount = prop.Value.GetInt32(); continue; } - if (property.NameEquals("firstSequenceNumber"u8)) + if (prop.NameEquals("firstSequenceNumber"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - firstSequenceNumber = property.Value.GetInt32(); + firstSequenceNumber = prop.Value.GetInt32(); continue; } - if (property.NameEquals("lastSequenceNumber"u8)) + if (prop.NameEquals("lastSequenceNumber"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - lastSequenceNumber = property.Value.GetInt32(); + lastSequenceNumber = prop.Value.GetInt32(); continue; } - if (property.NameEquals("firstEnqueueTime"u8)) + if (prop.NameEquals("firstEnqueueTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - firstEnqueueTime = property.Value.GetDateTimeOffset("O"); + firstEnqueueTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("lastEnqueueTime"u8)) + if (prop.NameEquals("lastEnqueueTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - lastEnqueueTime = property.Value.GetDateTimeOffset("O"); + lastEnqueueTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new EventHubCaptureFileCreatedEventData( - fileUrl, + fileurl, fileType, partitionId, sizeInBytes, @@ -207,13 +214,16 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi lastSequenceNumber, firstEnqueueTime, lastEnqueueTime, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - EventHubCaptureFileCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + EventHubCaptureFileCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual EventHubCaptureFileCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeEventHubCaptureFileCreatedEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ EventHubCaptureFileCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static EventHubCaptureFileCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeEventHubCaptureFileCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class EventHubCaptureFileCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, EventHubCaptureFileCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override EventHubCaptureFileCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeEventHubCaptureFileCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventHubCaptureFileCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs index 5f9b01e7d9f9..f11aa59b9421 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event. public partial class EventHubCaptureFileCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The path to the capture file. /// The file type of the capture file. /// The shard ID. - /// , or is null. internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId) { - Argument.AssertNotNull(fileurl, nameof(fileurl)); - Argument.AssertNotNull(fileType, nameof(fileType)); - Argument.AssertNotNull(partitionId, nameof(partitionId)); - Fileurl = fileurl; FileType = fileType; PartitionId = partitionId; @@ -71,8 +37,8 @@ internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, st /// The last sequence number from the queue. /// The first time from the queue. /// The last time from the queue. - /// Keeps track of any properties unknown to the library. - internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset? firstEnqueueTime, DateTimeOffset? lastEnqueueTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset? firstEnqueueTime, DateTimeOffset? lastEnqueueTime, IDictionary additionalBinaryDataProperties) { Fileurl = fileurl; FileType = fileType; @@ -83,30 +49,33 @@ internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, st LastSequenceNumber = lastSequenceNumber; FirstEnqueueTime = firstEnqueueTime; LastEnqueueTime = lastEnqueueTime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal EventHubCaptureFileCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The path to the capture file. public string Fileurl { get; } + /// The file type of the capture file. public string FileType { get; } + /// The shard ID. public string PartitionId { get; } + /// The file size. public int? SizeInBytes { get; } + /// The number of events in the file. public int? EventCount { get; } + /// The smallest sequence number from the queue. public int? FirstSequenceNumber { get; } + /// The last sequence number from the queue. public int? LastSequenceNumber { get; } + /// The first time from the queue. public DateTimeOffset? FirstEnqueueTime { get; } + /// The last time from the queue. public DateTimeOffset? LastEnqueueTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.Serialization.cs index 2534895bb53a..14b9deb406c1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event. [JsonConverter(typeof(HealthcareDicomImageCreatedEventDataConverter))] - public partial class HealthcareDicomImageCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class HealthcareDicomImageCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HealthcareDicomImageCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareDicomImageCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("partitionName"u8); writer.WriteStringValue(PartitionName); writer.WritePropertyName("imageStudyInstanceUid"u8); @@ -51,15 +55,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +72,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthcareDicomImageCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HealthcareDicomImageCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HealthcareDicomImageCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareDicomImageCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHealthcareDicomImageCreatedEventData(document.RootElement, options); } - internal static HealthcareDicomImageCreatedEventData DeserializeHealthcareDicomImageCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HealthcareDicomImageCreatedEventData DeserializeHealthcareDicomImageCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,50 +103,48 @@ internal static HealthcareDicomImageCreatedEventData DeserializeHealthcareDicomI string imageSopInstanceUid = default; string serviceHostName = default; long? sequenceNumber = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("partitionName"u8)) + if (prop.NameEquals("partitionName"u8)) { - partitionName = property.Value.GetString(); + partitionName = prop.Value.GetString(); continue; } - if (property.NameEquals("imageStudyInstanceUid"u8)) + if (prop.NameEquals("imageStudyInstanceUid"u8)) { - imageStudyInstanceUid = property.Value.GetString(); + imageStudyInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("imageSeriesInstanceUid"u8)) + if (prop.NameEquals("imageSeriesInstanceUid"u8)) { - imageSeriesInstanceUid = property.Value.GetString(); + imageSeriesInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("imageSopInstanceUid"u8)) + if (prop.NameEquals("imageSopInstanceUid"u8)) { - imageSopInstanceUid = property.Value.GetString(); + imageSopInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("serviceHostName"u8)) + if (prop.NameEquals("serviceHostName"u8)) { - serviceHostName = property.Value.GetString(); + serviceHostName = prop.Value.GetString(); continue; } - if (property.NameEquals("sequenceNumber"u8)) + if (prop.NameEquals("sequenceNumber"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sequenceNumber = property.Value.GetInt64(); + sequenceNumber = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new HealthcareDicomImageCreatedEventData( partitionName, imageStudyInstanceUid, @@ -145,13 +152,16 @@ internal static HealthcareDicomImageCreatedEventData DeserializeHealthcareDicomI imageSopInstanceUid, serviceHostName, sequenceNumber, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -161,15 +171,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - HealthcareDicomImageCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HealthcareDicomImageCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HealthcareDicomImageCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHealthcareDicomImageCreatedEventData(document.RootElement, options); } default: @@ -177,35 +192,28 @@ HealthcareDicomImageCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static HealthcareDicomImageCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeHealthcareDicomImageCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class HealthcareDicomImageCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, HealthcareDicomImageCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override HealthcareDicomImageCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthcareDicomImageCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthcareDicomImageCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.cs index 8202334c23bd..c55be85d647a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event. public partial class HealthcareDicomImageCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Data partition name. @@ -51,15 +22,8 @@ public partial class HealthcareDicomImageCreatedEventData /// Unique identifier for the Series. /// Unique identifier for the DICOM Image. /// Domain name of the DICOM account for this image. - /// , , , or is null. internal HealthcareDicomImageCreatedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName) { - Argument.AssertNotNull(partitionName, nameof(partitionName)); - Argument.AssertNotNull(imageStudyInstanceUid, nameof(imageStudyInstanceUid)); - Argument.AssertNotNull(imageSeriesInstanceUid, nameof(imageSeriesInstanceUid)); - Argument.AssertNotNull(imageSopInstanceUid, nameof(imageSopInstanceUid)); - Argument.AssertNotNull(serviceHostName, nameof(serviceHostName)); - PartitionName = partitionName; ImageStudyInstanceUid = imageStudyInstanceUid; ImageSeriesInstanceUid = imageSeriesInstanceUid; @@ -74,8 +38,8 @@ internal HealthcareDicomImageCreatedEventData(string partitionName, string image /// Unique identifier for the DICOM Image. /// Domain name of the DICOM account for this image. /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service. - /// Keeps track of any properties unknown to the library. - internal HealthcareDicomImageCreatedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName, long? sequenceNumber, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HealthcareDicomImageCreatedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName, long? sequenceNumber, IDictionary additionalBinaryDataProperties) { PartitionName = partitionName; ImageStudyInstanceUid = imageStudyInstanceUid; @@ -83,24 +47,24 @@ internal HealthcareDicomImageCreatedEventData(string partitionName, string image ImageSopInstanceUid = imageSopInstanceUid; ServiceHostName = serviceHostName; SequenceNumber = sequenceNumber; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HealthcareDicomImageCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Data partition name. public string PartitionName { get; } + /// Unique identifier for the Study. public string ImageStudyInstanceUid { get; } + /// Unique identifier for the Series. public string ImageSeriesInstanceUid { get; } + /// Unique identifier for the DICOM Image. public string ImageSopInstanceUid { get; } + /// Domain name of the DICOM account for this image. public string ServiceHostName { get; } + /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service. public long? SequenceNumber { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.Serialization.cs index 2dc40ad07719..bc06662b530b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event. [JsonConverter(typeof(HealthcareDicomImageDeletedEventDataConverter))] - public partial class HealthcareDicomImageDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class HealthcareDicomImageDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HealthcareDicomImageDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareDicomImageDeletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("partitionName"u8); writer.WriteStringValue(PartitionName); writer.WritePropertyName("imageStudyInstanceUid"u8); @@ -51,15 +55,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +72,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthcareDicomImageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HealthcareDicomImageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HealthcareDicomImageDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareDicomImageDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHealthcareDicomImageDeletedEventData(document.RootElement, options); } - internal static HealthcareDicomImageDeletedEventData DeserializeHealthcareDicomImageDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HealthcareDicomImageDeletedEventData DeserializeHealthcareDicomImageDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,50 +103,48 @@ internal static HealthcareDicomImageDeletedEventData DeserializeHealthcareDicomI string imageSopInstanceUid = default; string serviceHostName = default; long? sequenceNumber = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("partitionName"u8)) + if (prop.NameEquals("partitionName"u8)) { - partitionName = property.Value.GetString(); + partitionName = prop.Value.GetString(); continue; } - if (property.NameEquals("imageStudyInstanceUid"u8)) + if (prop.NameEquals("imageStudyInstanceUid"u8)) { - imageStudyInstanceUid = property.Value.GetString(); + imageStudyInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("imageSeriesInstanceUid"u8)) + if (prop.NameEquals("imageSeriesInstanceUid"u8)) { - imageSeriesInstanceUid = property.Value.GetString(); + imageSeriesInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("imageSopInstanceUid"u8)) + if (prop.NameEquals("imageSopInstanceUid"u8)) { - imageSopInstanceUid = property.Value.GetString(); + imageSopInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("serviceHostName"u8)) + if (prop.NameEquals("serviceHostName"u8)) { - serviceHostName = property.Value.GetString(); + serviceHostName = prop.Value.GetString(); continue; } - if (property.NameEquals("sequenceNumber"u8)) + if (prop.NameEquals("sequenceNumber"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sequenceNumber = property.Value.GetInt64(); + sequenceNumber = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new HealthcareDicomImageDeletedEventData( partitionName, imageStudyInstanceUid, @@ -145,13 +152,16 @@ internal static HealthcareDicomImageDeletedEventData DeserializeHealthcareDicomI imageSopInstanceUid, serviceHostName, sequenceNumber, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -161,15 +171,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - HealthcareDicomImageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HealthcareDicomImageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HealthcareDicomImageDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHealthcareDicomImageDeletedEventData(document.RootElement, options); } default: @@ -177,35 +192,28 @@ HealthcareDicomImageDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static HealthcareDicomImageDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeHealthcareDicomImageDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class HealthcareDicomImageDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, HealthcareDicomImageDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override HealthcareDicomImageDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthcareDicomImageDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthcareDicomImageDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.cs index 01ba56441069..f0a0f4f40a64 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event. public partial class HealthcareDicomImageDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Data partition name. @@ -51,15 +22,8 @@ public partial class HealthcareDicomImageDeletedEventData /// Unique identifier for the Series. /// Unique identifier for the DICOM Image. /// Host name of the DICOM account for this image. - /// , , , or is null. internal HealthcareDicomImageDeletedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName) { - Argument.AssertNotNull(partitionName, nameof(partitionName)); - Argument.AssertNotNull(imageStudyInstanceUid, nameof(imageStudyInstanceUid)); - Argument.AssertNotNull(imageSeriesInstanceUid, nameof(imageSeriesInstanceUid)); - Argument.AssertNotNull(imageSopInstanceUid, nameof(imageSopInstanceUid)); - Argument.AssertNotNull(serviceHostName, nameof(serviceHostName)); - PartitionName = partitionName; ImageStudyInstanceUid = imageStudyInstanceUid; ImageSeriesInstanceUid = imageSeriesInstanceUid; @@ -74,8 +38,8 @@ internal HealthcareDicomImageDeletedEventData(string partitionName, string image /// Unique identifier for the DICOM Image. /// Host name of the DICOM account for this image. /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service. - /// Keeps track of any properties unknown to the library. - internal HealthcareDicomImageDeletedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName, long? sequenceNumber, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HealthcareDicomImageDeletedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName, long? sequenceNumber, IDictionary additionalBinaryDataProperties) { PartitionName = partitionName; ImageStudyInstanceUid = imageStudyInstanceUid; @@ -83,24 +47,24 @@ internal HealthcareDicomImageDeletedEventData(string partitionName, string image ImageSopInstanceUid = imageSopInstanceUid; ServiceHostName = serviceHostName; SequenceNumber = sequenceNumber; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HealthcareDicomImageDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Data partition name. public string PartitionName { get; } + /// Unique identifier for the Study. public string ImageStudyInstanceUid { get; } + /// Unique identifier for the Series. public string ImageSeriesInstanceUid { get; } + /// Unique identifier for the DICOM Image. public string ImageSopInstanceUid { get; } + /// Host name of the DICOM account for this image. public string ServiceHostName { get; } + /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service. public long? SequenceNumber { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.Serialization.cs index 92156712f308..74909c315f06 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageUpdated event. [JsonConverter(typeof(HealthcareDicomImageUpdatedEventDataConverter))] - public partial class HealthcareDicomImageUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class HealthcareDicomImageUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HealthcareDicomImageUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareDicomImageUpdatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("partitionName"u8); writer.WriteStringValue(PartitionName); writer.WritePropertyName("imageStudyInstanceUid"u8); @@ -51,15 +55,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +72,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthcareDicomImageUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HealthcareDicomImageUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HealthcareDicomImageUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareDicomImageUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHealthcareDicomImageUpdatedEventData(document.RootElement, options); } - internal static HealthcareDicomImageUpdatedEventData DeserializeHealthcareDicomImageUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HealthcareDicomImageUpdatedEventData DeserializeHealthcareDicomImageUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,50 +103,48 @@ internal static HealthcareDicomImageUpdatedEventData DeserializeHealthcareDicomI string imageSopInstanceUid = default; string serviceHostName = default; long? sequenceNumber = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("partitionName"u8)) + if (prop.NameEquals("partitionName"u8)) { - partitionName = property.Value.GetString(); + partitionName = prop.Value.GetString(); continue; } - if (property.NameEquals("imageStudyInstanceUid"u8)) + if (prop.NameEquals("imageStudyInstanceUid"u8)) { - imageStudyInstanceUid = property.Value.GetString(); + imageStudyInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("imageSeriesInstanceUid"u8)) + if (prop.NameEquals("imageSeriesInstanceUid"u8)) { - imageSeriesInstanceUid = property.Value.GetString(); + imageSeriesInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("imageSopInstanceUid"u8)) + if (prop.NameEquals("imageSopInstanceUid"u8)) { - imageSopInstanceUid = property.Value.GetString(); + imageSopInstanceUid = prop.Value.GetString(); continue; } - if (property.NameEquals("serviceHostName"u8)) + if (prop.NameEquals("serviceHostName"u8)) { - serviceHostName = property.Value.GetString(); + serviceHostName = prop.Value.GetString(); continue; } - if (property.NameEquals("sequenceNumber"u8)) + if (prop.NameEquals("sequenceNumber"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sequenceNumber = property.Value.GetInt64(); + sequenceNumber = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new HealthcareDicomImageUpdatedEventData( partitionName, imageStudyInstanceUid, @@ -145,13 +152,16 @@ internal static HealthcareDicomImageUpdatedEventData DeserializeHealthcareDicomI imageSopInstanceUid, serviceHostName, sequenceNumber, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -161,15 +171,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - HealthcareDicomImageUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HealthcareDicomImageUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HealthcareDicomImageUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHealthcareDicomImageUpdatedEventData(document.RootElement, options); } default: @@ -177,35 +192,28 @@ HealthcareDicomImageUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static HealthcareDicomImageUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeHealthcareDicomImageUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class HealthcareDicomImageUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, HealthcareDicomImageUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override HealthcareDicomImageUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthcareDicomImageUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthcareDicomImageUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.cs index f81a0ac11aa9..b7445a4185db 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageUpdated event. public partial class HealthcareDicomImageUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Data partition name. @@ -51,15 +22,8 @@ public partial class HealthcareDicomImageUpdatedEventData /// Unique identifier for the Series. /// Unique identifier for the DICOM Image. /// Domain name of the DICOM account for this image. - /// , , , or is null. internal HealthcareDicomImageUpdatedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName) { - Argument.AssertNotNull(partitionName, nameof(partitionName)); - Argument.AssertNotNull(imageStudyInstanceUid, nameof(imageStudyInstanceUid)); - Argument.AssertNotNull(imageSeriesInstanceUid, nameof(imageSeriesInstanceUid)); - Argument.AssertNotNull(imageSopInstanceUid, nameof(imageSopInstanceUid)); - Argument.AssertNotNull(serviceHostName, nameof(serviceHostName)); - PartitionName = partitionName; ImageStudyInstanceUid = imageStudyInstanceUid; ImageSeriesInstanceUid = imageSeriesInstanceUid; @@ -74,8 +38,8 @@ internal HealthcareDicomImageUpdatedEventData(string partitionName, string image /// Unique identifier for the DICOM Image. /// Domain name of the DICOM account for this image. /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation, updation and deletion within the service. - /// Keeps track of any properties unknown to the library. - internal HealthcareDicomImageUpdatedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName, long? sequenceNumber, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HealthcareDicomImageUpdatedEventData(string partitionName, string imageStudyInstanceUid, string imageSeriesInstanceUid, string imageSopInstanceUid, string serviceHostName, long? sequenceNumber, IDictionary additionalBinaryDataProperties) { PartitionName = partitionName; ImageStudyInstanceUid = imageStudyInstanceUid; @@ -83,24 +47,24 @@ internal HealthcareDicomImageUpdatedEventData(string partitionName, string image ImageSopInstanceUid = imageSopInstanceUid; ServiceHostName = serviceHostName; SequenceNumber = sequenceNumber; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HealthcareDicomImageUpdatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Data partition name. public string PartitionName { get; } + /// Unique identifier for the Study. public string ImageStudyInstanceUid { get; } + /// Unique identifier for the Series. public string ImageSeriesInstanceUid { get; } + /// Unique identifier for the DICOM Image. public string ImageSopInstanceUid { get; } + /// Domain name of the DICOM account for this image. public string ServiceHostName { get; } + /// Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation, updation and deletion within the service. public long? SequenceNumber { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs index 9982d17c5376..4eea8ac3841a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event. [JsonConverter(typeof(HealthcareFhirResourceCreatedEventDataConverter))] - public partial class HealthcareFhirResourceCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class HealthcareFhirResourceCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HealthcareFhirResourceCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareFhirResourceCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(FhirResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourceVersionId"u8); writer.WriteNumberValue(FhirResourceVersionId.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,75 +71,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthcareFhirResourceCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HealthcareFhirResourceCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HealthcareFhirResourceCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareFhirResourceCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHealthcareFhirResourceCreatedEventData(document.RootElement, options); } - internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhirResourceCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhirResourceCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - HealthcareFhirResourceType? resourceType = default; - string resourceFhirAccount = default; - string resourceFhirId = default; - long? resourceVersionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + HealthcareFhirResourceType? fhirResourceType = default; + string fhirServiceHostName = default; + string fhirResourceId = default; + long? fhirResourceVersionId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceType"u8)) + if (prop.NameEquals("resourceType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceType = new HealthcareFhirResourceType(property.Value.GetString()); + fhirResourceType = new HealthcareFhirResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("resourceFhirAccount"u8)) + if (prop.NameEquals("resourceFhirAccount"u8)) { - resourceFhirAccount = property.Value.GetString(); + fhirServiceHostName = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceFhirId"u8)) + if (prop.NameEquals("resourceFhirId"u8)) { - resourceFhirId = property.Value.GetString(); + fhirResourceId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceVersionId"u8)) + if (prop.NameEquals("resourceVersionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceVersionId = property.Value.GetInt64(); + fhirResourceVersionId = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new HealthcareFhirResourceCreatedEventData(resourceType, resourceFhirAccount, resourceFhirId, resourceVersionId, serializedAdditionalRawData); + return new HealthcareFhirResourceCreatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -145,15 +155,20 @@ BinaryData IPersistableModel.Write(Model } } - HealthcareFhirResourceCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HealthcareFhirResourceCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HealthcareFhirResourceCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHealthcareFhirResourceCreatedEventData(document.RootElement, options); } default: @@ -161,35 +176,28 @@ HealthcareFhirResourceCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static HealthcareFhirResourceCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeHealthcareFhirResourceCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class HealthcareFhirResourceCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, HealthcareFhirResourceCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override HealthcareFhirResourceCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthcareFhirResourceCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthcareFhirResourceCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs index f6ed3ccbdae2..81b58c190d91 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event. public partial class HealthcareFhirResourceCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. - /// or is null. internal HealthcareFhirResourceCreatedEventData(string fhirServiceHostName, string fhirResourceId) { - Argument.AssertNotNull(fhirServiceHostName, nameof(fhirServiceHostName)); - Argument.AssertNotNull(fhirResourceId, nameof(fhirResourceId)); - FhirServiceHostName = fhirServiceHostName; FhirResourceId = fhirResourceId; } @@ -63,27 +30,25 @@ internal HealthcareFhirResourceCreatedEventData(string fhirServiceHostName, stri /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). - /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary additionalBinaryDataProperties) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; FhirResourceId = fhirResourceId; FhirResourceVersionId = fhirResourceVersionId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Type of HL7 FHIR resource. public HealthcareFhirResourceType? FhirResourceType { get; } + /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } + /// Id of HL7 FHIR resource. public string FhirResourceId { get; } + /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). public long? FhirResourceVersionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs index 9348e6cac7ee..208d64798455 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event. [JsonConverter(typeof(HealthcareFhirResourceDeletedEventDataConverter))] - public partial class HealthcareFhirResourceDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class HealthcareFhirResourceDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HealthcareFhirResourceDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareFhirResourceDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(FhirResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourceVersionId"u8); writer.WriteNumberValue(FhirResourceVersionId.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,75 +71,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthcareFhirResourceDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HealthcareFhirResourceDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HealthcareFhirResourceDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareFhirResourceDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHealthcareFhirResourceDeletedEventData(document.RootElement, options); } - internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhirResourceDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhirResourceDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - HealthcareFhirResourceType? resourceType = default; - string resourceFhirAccount = default; - string resourceFhirId = default; - long? resourceVersionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + HealthcareFhirResourceType? fhirResourceType = default; + string fhirServiceHostName = default; + string fhirResourceId = default; + long? fhirResourceVersionId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceType"u8)) + if (prop.NameEquals("resourceType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceType = new HealthcareFhirResourceType(property.Value.GetString()); + fhirResourceType = new HealthcareFhirResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("resourceFhirAccount"u8)) + if (prop.NameEquals("resourceFhirAccount"u8)) { - resourceFhirAccount = property.Value.GetString(); + fhirServiceHostName = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceFhirId"u8)) + if (prop.NameEquals("resourceFhirId"u8)) { - resourceFhirId = property.Value.GetString(); + fhirResourceId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceVersionId"u8)) + if (prop.NameEquals("resourceVersionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceVersionId = property.Value.GetInt64(); + fhirResourceVersionId = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new HealthcareFhirResourceDeletedEventData(resourceType, resourceFhirAccount, resourceFhirId, resourceVersionId, serializedAdditionalRawData); + return new HealthcareFhirResourceDeletedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -145,15 +155,20 @@ BinaryData IPersistableModel.Write(Model } } - HealthcareFhirResourceDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HealthcareFhirResourceDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HealthcareFhirResourceDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHealthcareFhirResourceDeletedEventData(document.RootElement, options); } default: @@ -161,35 +176,28 @@ HealthcareFhirResourceDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static HealthcareFhirResourceDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeHealthcareFhirResourceDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class HealthcareFhirResourceDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, HealthcareFhirResourceDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override HealthcareFhirResourceDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthcareFhirResourceDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthcareFhirResourceDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs index 441bbec65068..8520285a439d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event. public partial class HealthcareFhirResourceDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. - /// or is null. internal HealthcareFhirResourceDeletedEventData(string fhirServiceHostName, string fhirResourceId) { - Argument.AssertNotNull(fhirServiceHostName, nameof(fhirServiceHostName)); - Argument.AssertNotNull(fhirResourceId, nameof(fhirResourceId)); - FhirServiceHostName = fhirServiceHostName; FhirResourceId = fhirResourceId; } @@ -63,27 +30,25 @@ internal HealthcareFhirResourceDeletedEventData(string fhirServiceHostName, stri /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). - /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary additionalBinaryDataProperties) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; FhirResourceId = fhirResourceId; FhirResourceVersionId = fhirResourceVersionId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Type of HL7 FHIR resource. public HealthcareFhirResourceType? FhirResourceType { get; } + /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } + /// Id of HL7 FHIR resource. public string FhirResourceId { get; } + /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). public long? FhirResourceVersionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceType.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceType.cs index 895fc9c8b46f..3efeaf24124b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceType.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceType.cs @@ -14,515 +14,852 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct HealthcareFhirResourceType : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public HealthcareFhirResourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The FHIR resource type defined in STU3 and R4. private const string AccountValue = "Account"; + /// The FHIR resource type defined in STU3 and R4. private const string ActivityDefinitionValue = "ActivityDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string AdverseEventValue = "AdverseEvent"; + /// The FHIR resource type defined in STU3 and R4. private const string AllergyIntoleranceValue = "AllergyIntolerance"; + /// The FHIR resource type defined in STU3 and R4. private const string AppointmentValue = "Appointment"; + /// The FHIR resource type defined in STU3 and R4. private const string AppointmentResponseValue = "AppointmentResponse"; + /// The FHIR resource type defined in STU3 and R4. private const string AuditEventValue = "AuditEvent"; + /// The FHIR resource type defined in STU3 and R4. private const string BasicValue = "Basic"; + /// The FHIR resource type defined in STU3 and R4. private const string BinaryValue = "Binary"; + /// The FHIR resource type defined in R4. private const string BiologicallyDerivedProductValue = "BiologicallyDerivedProduct"; + /// The FHIR resource type defined in STU3. private const string BodySiteValue = "BodySite"; + /// The FHIR resource type defined in R4. private const string BodyStructureValue = "BodyStructure"; + /// The FHIR resource type defined in STU3 and R4. private const string BundleValue = "Bundle"; + /// The FHIR resource type defined in STU3 and R4. private const string CapabilityStatementValue = "CapabilityStatement"; + /// The FHIR resource type defined in STU3 and R4. private const string CarePlanValue = "CarePlan"; + /// The FHIR resource type defined in STU3 and R4. private const string CareTeamValue = "CareTeam"; + /// The FHIR resource type defined in R4. private const string CatalogEntryValue = "CatalogEntry"; + /// The FHIR resource type defined in STU3 and R4. private const string ChargeItemValue = "ChargeItem"; + /// The FHIR resource type defined in R4. private const string ChargeItemDefinitionValue = "ChargeItemDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string ClaimValue = "Claim"; + /// The FHIR resource type defined in STU3 and R4. private const string ClaimResponseValue = "ClaimResponse"; + /// The FHIR resource type defined in STU3 and R4. private const string ClinicalImpressionValue = "ClinicalImpression"; + /// The FHIR resource type defined in STU3 and R4. private const string CodeSystemValue = "CodeSystem"; + /// The FHIR resource type defined in STU3 and R4. private const string CommunicationValue = "Communication"; + /// The FHIR resource type defined in STU3 and R4. private const string CommunicationRequestValue = "CommunicationRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string CompartmentDefinitionValue = "CompartmentDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string CompositionValue = "Composition"; + /// The FHIR resource type defined in STU3 and R4. private const string ConceptMapValue = "ConceptMap"; + /// The FHIR resource type defined in STU3 and R4. private const string ConditionValue = "Condition"; + /// The FHIR resource type defined in STU3 and R4. private const string ConsentValue = "Consent"; + /// The FHIR resource type defined in STU3 and R4. private const string ContractValue = "Contract"; + /// The FHIR resource type defined in STU3 and R4. private const string CoverageValue = "Coverage"; + /// The FHIR resource type defined in R4. private const string CoverageEligibilityRequestValue = "CoverageEligibilityRequest"; + /// The FHIR resource type defined in R4. private const string CoverageEligibilityResponseValue = "CoverageEligibilityResponse"; + /// The FHIR resource type defined in STU3. private const string DataElementValue = "DataElement"; + /// The FHIR resource type defined in STU3 and R4. private const string DetectedIssueValue = "DetectedIssue"; + /// The FHIR resource type defined in STU3 and R4. private const string DeviceValue = "Device"; + /// The FHIR resource type defined in STU3. private const string DeviceComponentValue = "DeviceComponent"; + /// The FHIR resource type defined in R4. private const string DeviceDefinitionValue = "DeviceDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string DeviceMetricValue = "DeviceMetric"; + /// The FHIR resource type defined in STU3 and R4. private const string DeviceRequestValue = "DeviceRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string DeviceUseStatementValue = "DeviceUseStatement"; + /// The FHIR resource type defined in STU3 and R4. private const string DiagnosticReportValue = "DiagnosticReport"; + /// The FHIR resource type defined in STU3 and R4. private const string DocumentManifestValue = "DocumentManifest"; + /// The FHIR resource type defined in STU3 and R4. private const string DocumentReferenceValue = "DocumentReference"; + /// The FHIR resource type defined in STU3 and R4. private const string DomainResourceValue = "DomainResource"; + /// The FHIR resource type defined in R4. private const string EffectEvidenceSynthesisValue = "EffectEvidenceSynthesis"; + /// The FHIR resource type defined in STU3. private const string EligibilityRequestValue = "EligibilityRequest"; + /// The FHIR resource type defined in STU3. private const string EligibilityResponseValue = "EligibilityResponse"; + /// The FHIR resource type defined in STU3 and R4. private const string EncounterValue = "Encounter"; + /// The FHIR resource type defined in STU3 and R4. private const string EndpointValue = "Endpoint"; + /// The FHIR resource type defined in STU3 and R4. private const string EnrollmentRequestValue = "EnrollmentRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string EnrollmentResponseValue = "EnrollmentResponse"; + /// The FHIR resource type defined in STU3 and R4. private const string EpisodeOfCareValue = "EpisodeOfCare"; + /// The FHIR resource type defined in R4. private const string EventDefinitionValue = "EventDefinition"; + /// The FHIR resource type defined in R4. private const string EvidenceValue = "Evidence"; + /// The FHIR resource type defined in R4. private const string EvidenceVariableValue = "EvidenceVariable"; + /// The FHIR resource type defined in R4. private const string ExampleScenarioValue = "ExampleScenario"; + /// The FHIR resource type defined in STU3. private const string ExpansionProfileValue = "ExpansionProfile"; + /// The FHIR resource type defined in STU3 and R4. private const string ExplanationOfBenefitValue = "ExplanationOfBenefit"; + /// The FHIR resource type defined in STU3 and R4. private const string FamilyMemberHistoryValue = "FamilyMemberHistory"; + /// The FHIR resource type defined in STU3 and R4. private const string FlagValue = "Flag"; + /// The FHIR resource type defined in STU3 and R4. private const string GoalValue = "Goal"; + /// The FHIR resource type defined in STU3 and R4. private const string GraphDefinitionValue = "GraphDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string GroupValue = "Group"; + /// The FHIR resource type defined in STU3 and R4. private const string GuidanceResponseValue = "GuidanceResponse"; + /// The FHIR resource type defined in STU3 and R4. private const string HealthcareServiceValue = "HealthcareService"; + /// The FHIR resource type defined in STU3. private const string ImagingManifestValue = "ImagingManifest"; + /// The FHIR resource type defined in STU3 and R4. private const string ImagingStudyValue = "ImagingStudy"; + /// The FHIR resource type defined in STU3 and R4. private const string ImmunizationValue = "Immunization"; + /// The FHIR resource type defined in R4. private const string ImmunizationEvaluationValue = "ImmunizationEvaluation"; + /// The FHIR resource type defined in STU3 and R4. private const string ImmunizationRecommendationValue = "ImmunizationRecommendation"; + /// The FHIR resource type defined in STU3 and R4. private const string ImplementationGuideValue = "ImplementationGuide"; + /// The FHIR resource type defined in R4. private const string InsurancePlanValue = "InsurancePlan"; + /// The FHIR resource type defined in R4. private const string InvoiceValue = "Invoice"; + /// The FHIR resource type defined in STU3 and R4. private const string LibraryValue = "Library"; + /// The FHIR resource type defined in STU3 and R4. private const string LinkageValue = "Linkage"; + /// The FHIR resource type defined in STU3 and R4. private const string ListValue = "List"; + /// The FHIR resource type defined in STU3 and R4. private const string LocationValue = "Location"; + /// The FHIR resource type defined in STU3 and R4. private const string MeasureValue = "Measure"; + /// The FHIR resource type defined in STU3 and R4. private const string MeasureReportValue = "MeasureReport"; + /// The FHIR resource type defined in STU3 and R4. private const string MediaValue = "Media"; + /// The FHIR resource type defined in STU3 and R4. private const string MedicationValue = "Medication"; + /// The FHIR resource type defined in STU3 and R4. private const string MedicationAdministrationValue = "MedicationAdministration"; + /// The FHIR resource type defined in STU3 and R4. private const string MedicationDispenseValue = "MedicationDispense"; + /// The FHIR resource type defined in R4. private const string MedicationKnowledgeValue = "MedicationKnowledge"; + /// The FHIR resource type defined in STU3 and R4. private const string MedicationRequestValue = "MedicationRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string MedicationStatementValue = "MedicationStatement"; + /// The FHIR resource type defined in R4. private const string MedicinalProductValue = "MedicinalProduct"; + /// The FHIR resource type defined in R4. private const string MedicinalProductAuthorizationValue = "MedicinalProductAuthorization"; + /// The FHIR resource type defined in R4. private const string MedicinalProductContraindicationValue = "MedicinalProductContraindication"; + /// The FHIR resource type defined in R4. private const string MedicinalProductIndicationValue = "MedicinalProductIndication"; + /// The FHIR resource type defined in R4. private const string MedicinalProductIngredientValue = "MedicinalProductIngredient"; + /// The FHIR resource type defined in R4. private const string MedicinalProductInteractionValue = "MedicinalProductInteraction"; + /// The FHIR resource type defined in R4. private const string MedicinalProductManufacturedValue = "MedicinalProductManufactured"; + /// The FHIR resource type defined in R4. private const string MedicinalProductPackagedValue = "MedicinalProductPackaged"; + /// The FHIR resource type defined in R4. private const string MedicinalProductPharmaceuticalValue = "MedicinalProductPharmaceutical"; + /// The FHIR resource type defined in R4. private const string MedicinalProductUndesirableEffectValue = "MedicinalProductUndesirableEffect"; + /// The FHIR resource type defined in STU3 and R4. private const string MessageDefinitionValue = "MessageDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string MessageHeaderValue = "MessageHeader"; + /// The FHIR resource type defined in R4. private const string MolecularSequenceValue = "MolecularSequence"; + /// The FHIR resource type defined in STU3 and R4. private const string NamingSystemValue = "NamingSystem"; + /// The FHIR resource type defined in STU3 and R4. private const string NutritionOrderValue = "NutritionOrder"; + /// The FHIR resource type defined in STU3 and R4. private const string ObservationValue = "Observation"; + /// The FHIR resource type defined in R4. private const string ObservationDefinitionValue = "ObservationDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string OperationDefinitionValue = "OperationDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string OperationOutcomeValue = "OperationOutcome"; + /// The FHIR resource type defined in STU3 and R4. private const string OrganizationValue = "Organization"; + /// The FHIR resource type defined in R4. private const string OrganizationAffiliationValue = "OrganizationAffiliation"; + /// The FHIR resource type defined in STU3 and R4. private const string ParametersValue = "Parameters"; + /// The FHIR resource type defined in STU3 and R4. private const string PatientValue = "Patient"; + /// The FHIR resource type defined in STU3 and R4. private const string PaymentNoticeValue = "PaymentNotice"; + /// The FHIR resource type defined in STU3 and R4. private const string PaymentReconciliationValue = "PaymentReconciliation"; + /// The FHIR resource type defined in STU3 and R4. private const string PersonValue = "Person"; + /// The FHIR resource type defined in STU3 and R4. private const string PlanDefinitionValue = "PlanDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string PractitionerValue = "Practitioner"; + /// The FHIR resource type defined in STU3 and R4. private const string PractitionerRoleValue = "PractitionerRole"; + /// The FHIR resource type defined in STU3 and R4. private const string ProcedureValue = "Procedure"; + /// The FHIR resource type defined in STU3. private const string ProcedureRequestValue = "ProcedureRequest"; + /// The FHIR resource type defined in STU3. private const string ProcessRequestValue = "ProcessRequest"; + /// The FHIR resource type defined in STU3. private const string ProcessResponseValue = "ProcessResponse"; + /// The FHIR resource type defined in STU3 and R4. private const string ProvenanceValue = "Provenance"; + /// The FHIR resource type defined in STU3 and R4. private const string QuestionnaireValue = "Questionnaire"; + /// The FHIR resource type defined in STU3 and R4. private const string QuestionnaireResponseValue = "QuestionnaireResponse"; + /// The FHIR resource type defined in STU3. private const string ReferralRequestValue = "ReferralRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string RelatedPersonValue = "RelatedPerson"; + /// The FHIR resource type defined in STU3 and R4. private const string RequestGroupValue = "RequestGroup"; + /// The FHIR resource type defined in R4. private const string ResearchDefinitionValue = "ResearchDefinition"; + /// The FHIR resource type defined in R4. private const string ResearchElementDefinitionValue = "ResearchElementDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string ResearchStudyValue = "ResearchStudy"; + /// The FHIR resource type defined in STU3 and R4. private const string ResearchSubjectValue = "ResearchSubject"; + /// The FHIR resource type defined in STU3 and R4. private const string ResourceValue = "Resource"; + /// The FHIR resource type defined in STU3 and R4. private const string RiskAssessmentValue = "RiskAssessment"; + /// The FHIR resource type defined in R4. private const string RiskEvidenceSynthesisValue = "RiskEvidenceSynthesis"; + /// The FHIR resource type defined in STU3 and R4. private const string ScheduleValue = "Schedule"; + /// The FHIR resource type defined in STU3 and R4. private const string SearchParameterValue = "SearchParameter"; + /// The FHIR resource type defined in STU3. private const string SequenceValue = "Sequence"; + /// The FHIR resource type defined in STU3. private const string ServiceDefinitionValue = "ServiceDefinition"; + /// The FHIR resource type defined in R4. private const string ServiceRequestValue = "ServiceRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string SlotValue = "Slot"; + /// The FHIR resource type defined in STU3 and R4. private const string SpecimenValue = "Specimen"; + /// The FHIR resource type defined in R4. private const string SpecimenDefinitionValue = "SpecimenDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string StructureDefinitionValue = "StructureDefinition"; + /// The FHIR resource type defined in STU3 and R4. private const string StructureMapValue = "StructureMap"; + /// The FHIR resource type defined in STU3 and R4. private const string SubscriptionValue = "Subscription"; + /// The FHIR resource type defined in STU3 and R4. private const string SubstanceValue = "Substance"; + /// The FHIR resource type defined in R4. private const string SubstanceNucleicAcidValue = "SubstanceNucleicAcid"; + /// The FHIR resource type defined in R4. private const string SubstancePolymerValue = "SubstancePolymer"; + /// The FHIR resource type defined in R4. private const string SubstanceProteinValue = "SubstanceProtein"; + /// The FHIR resource type defined in R4. private const string SubstanceReferenceInformationValue = "SubstanceReferenceInformation"; + /// The FHIR resource type defined in R4. private const string SubstanceSourceMaterialValue = "SubstanceSourceMaterial"; + /// The FHIR resource type defined in R4. private const string SubstanceSpecificationValue = "SubstanceSpecification"; + /// The FHIR resource type defined in STU3 and R4. private const string SupplyDeliveryValue = "SupplyDelivery"; + /// The FHIR resource type defined in STU3 and R4. private const string SupplyRequestValue = "SupplyRequest"; + /// The FHIR resource type defined in STU3 and R4. private const string TaskValue = "Task"; + /// The FHIR resource type defined in R4. private const string TerminologyCapabilitiesValue = "TerminologyCapabilities"; + /// The FHIR resource type defined in STU3 and R4. private const string TestReportValue = "TestReport"; + /// The FHIR resource type defined in STU3 and R4. private const string TestScriptValue = "TestScript"; + /// The FHIR resource type defined in STU3 and R4. private const string ValueSetValue = "ValueSet"; + /// The FHIR resource type defined in R4. private const string VerificationResultValue = "VerificationResult"; + /// The FHIR resource type defined in STU3 and R4. private const string VisionPrescriptionValue = "VisionPrescription"; + /// Initializes a new instance of . + /// The value. + /// is null. + public HealthcareFhirResourceType(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Account { get; } = new HealthcareFhirResourceType(AccountValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ActivityDefinition { get; } = new HealthcareFhirResourceType(ActivityDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType AdverseEvent { get; } = new HealthcareFhirResourceType(AdverseEventValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType AllergyIntolerance { get; } = new HealthcareFhirResourceType(AllergyIntoleranceValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Appointment { get; } = new HealthcareFhirResourceType(AppointmentValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType AppointmentResponse { get; } = new HealthcareFhirResourceType(AppointmentResponseValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType AuditEvent { get; } = new HealthcareFhirResourceType(AuditEventValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Basic { get; } = new HealthcareFhirResourceType(BasicValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Binary { get; } = new HealthcareFhirResourceType(BinaryValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType BiologicallyDerivedProduct { get; } = new HealthcareFhirResourceType(BiologicallyDerivedProductValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType BodySite { get; } = new HealthcareFhirResourceType(BodySiteValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType BodyStructure { get; } = new HealthcareFhirResourceType(BodyStructureValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Bundle { get; } = new HealthcareFhirResourceType(BundleValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType CapabilityStatement { get; } = new HealthcareFhirResourceType(CapabilityStatementValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType CarePlan { get; } = new HealthcareFhirResourceType(CarePlanValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType CareTeam { get; } = new HealthcareFhirResourceType(CareTeamValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType CatalogEntry { get; } = new HealthcareFhirResourceType(CatalogEntryValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ChargeItem { get; } = new HealthcareFhirResourceType(ChargeItemValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ChargeItemDefinition { get; } = new HealthcareFhirResourceType(ChargeItemDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Claim { get; } = new HealthcareFhirResourceType(ClaimValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ClaimResponse { get; } = new HealthcareFhirResourceType(ClaimResponseValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ClinicalImpression { get; } = new HealthcareFhirResourceType(ClinicalImpressionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType CodeSystem { get; } = new HealthcareFhirResourceType(CodeSystemValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Communication { get; } = new HealthcareFhirResourceType(CommunicationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType CommunicationRequest { get; } = new HealthcareFhirResourceType(CommunicationRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType CompartmentDefinition { get; } = new HealthcareFhirResourceType(CompartmentDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Composition { get; } = new HealthcareFhirResourceType(CompositionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ConceptMap { get; } = new HealthcareFhirResourceType(ConceptMapValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Condition { get; } = new HealthcareFhirResourceType(ConditionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Consent { get; } = new HealthcareFhirResourceType(ConsentValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Contract { get; } = new HealthcareFhirResourceType(ContractValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Coverage { get; } = new HealthcareFhirResourceType(CoverageValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType CoverageEligibilityRequest { get; } = new HealthcareFhirResourceType(CoverageEligibilityRequestValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType CoverageEligibilityResponse { get; } = new HealthcareFhirResourceType(CoverageEligibilityResponseValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType DataElement { get; } = new HealthcareFhirResourceType(DataElementValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DetectedIssue { get; } = new HealthcareFhirResourceType(DetectedIssueValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Device { get; } = new HealthcareFhirResourceType(DeviceValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType DeviceComponent { get; } = new HealthcareFhirResourceType(DeviceComponentValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType DeviceDefinition { get; } = new HealthcareFhirResourceType(DeviceDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DeviceMetric { get; } = new HealthcareFhirResourceType(DeviceMetricValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DeviceRequest { get; } = new HealthcareFhirResourceType(DeviceRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DeviceUseStatement { get; } = new HealthcareFhirResourceType(DeviceUseStatementValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DiagnosticReport { get; } = new HealthcareFhirResourceType(DiagnosticReportValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DocumentManifest { get; } = new HealthcareFhirResourceType(DocumentManifestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DocumentReference { get; } = new HealthcareFhirResourceType(DocumentReferenceValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType DomainResource { get; } = new HealthcareFhirResourceType(DomainResourceValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType EffectEvidenceSynthesis { get; } = new HealthcareFhirResourceType(EffectEvidenceSynthesisValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType EligibilityRequest { get; } = new HealthcareFhirResourceType(EligibilityRequestValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType EligibilityResponse { get; } = new HealthcareFhirResourceType(EligibilityResponseValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Encounter { get; } = new HealthcareFhirResourceType(EncounterValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Endpoint { get; } = new HealthcareFhirResourceType(EndpointValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType EnrollmentRequest { get; } = new HealthcareFhirResourceType(EnrollmentRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType EnrollmentResponse { get; } = new HealthcareFhirResourceType(EnrollmentResponseValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType EpisodeOfCare { get; } = new HealthcareFhirResourceType(EpisodeOfCareValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType EventDefinition { get; } = new HealthcareFhirResourceType(EventDefinitionValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType Evidence { get; } = new HealthcareFhirResourceType(EvidenceValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType EvidenceVariable { get; } = new HealthcareFhirResourceType(EvidenceVariableValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ExampleScenario { get; } = new HealthcareFhirResourceType(ExampleScenarioValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ExpansionProfile { get; } = new HealthcareFhirResourceType(ExpansionProfileValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ExplanationOfBenefit { get; } = new HealthcareFhirResourceType(ExplanationOfBenefitValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType FamilyMemberHistory { get; } = new HealthcareFhirResourceType(FamilyMemberHistoryValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Flag { get; } = new HealthcareFhirResourceType(FlagValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Goal { get; } = new HealthcareFhirResourceType(GoalValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType GraphDefinition { get; } = new HealthcareFhirResourceType(GraphDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Group { get; } = new HealthcareFhirResourceType(GroupValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType GuidanceResponse { get; } = new HealthcareFhirResourceType(GuidanceResponseValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType HealthcareService { get; } = new HealthcareFhirResourceType(HealthcareServiceValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ImagingManifest { get; } = new HealthcareFhirResourceType(ImagingManifestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ImagingStudy { get; } = new HealthcareFhirResourceType(ImagingStudyValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Immunization { get; } = new HealthcareFhirResourceType(ImmunizationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ImmunizationEvaluation { get; } = new HealthcareFhirResourceType(ImmunizationEvaluationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ImmunizationRecommendation { get; } = new HealthcareFhirResourceType(ImmunizationRecommendationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ImplementationGuide { get; } = new HealthcareFhirResourceType(ImplementationGuideValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType InsurancePlan { get; } = new HealthcareFhirResourceType(InsurancePlanValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType Invoice { get; } = new HealthcareFhirResourceType(InvoiceValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Library { get; } = new HealthcareFhirResourceType(LibraryValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Linkage { get; } = new HealthcareFhirResourceType(LinkageValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType List { get; } = new HealthcareFhirResourceType(ListValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Location { get; } = new HealthcareFhirResourceType(LocationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Measure { get; } = new HealthcareFhirResourceType(MeasureValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MeasureReport { get; } = new HealthcareFhirResourceType(MeasureReportValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Media { get; } = new HealthcareFhirResourceType(MediaValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Medication { get; } = new HealthcareFhirResourceType(MedicationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MedicationAdministration { get; } = new HealthcareFhirResourceType(MedicationAdministrationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MedicationDispense { get; } = new HealthcareFhirResourceType(MedicationDispenseValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicationKnowledge { get; } = new HealthcareFhirResourceType(MedicationKnowledgeValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MedicationRequest { get; } = new HealthcareFhirResourceType(MedicationRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MedicationStatement { get; } = new HealthcareFhirResourceType(MedicationStatementValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProduct { get; } = new HealthcareFhirResourceType(MedicinalProductValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductAuthorization { get; } = new HealthcareFhirResourceType(MedicinalProductAuthorizationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductContraindication { get; } = new HealthcareFhirResourceType(MedicinalProductContraindicationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductIndication { get; } = new HealthcareFhirResourceType(MedicinalProductIndicationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductIngredient { get; } = new HealthcareFhirResourceType(MedicinalProductIngredientValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductInteraction { get; } = new HealthcareFhirResourceType(MedicinalProductInteractionValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductManufactured { get; } = new HealthcareFhirResourceType(MedicinalProductManufacturedValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductPackaged { get; } = new HealthcareFhirResourceType(MedicinalProductPackagedValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductPharmaceutical { get; } = new HealthcareFhirResourceType(MedicinalProductPharmaceuticalValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MedicinalProductUndesirableEffect { get; } = new HealthcareFhirResourceType(MedicinalProductUndesirableEffectValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MessageDefinition { get; } = new HealthcareFhirResourceType(MessageDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType MessageHeader { get; } = new HealthcareFhirResourceType(MessageHeaderValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType MolecularSequence { get; } = new HealthcareFhirResourceType(MolecularSequenceValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType NamingSystem { get; } = new HealthcareFhirResourceType(NamingSystemValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType NutritionOrder { get; } = new HealthcareFhirResourceType(NutritionOrderValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Observation { get; } = new HealthcareFhirResourceType(ObservationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ObservationDefinition { get; } = new HealthcareFhirResourceType(ObservationDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType OperationDefinition { get; } = new HealthcareFhirResourceType(OperationDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType OperationOutcome { get; } = new HealthcareFhirResourceType(OperationOutcomeValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Organization { get; } = new HealthcareFhirResourceType(OrganizationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType OrganizationAffiliation { get; } = new HealthcareFhirResourceType(OrganizationAffiliationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Parameters { get; } = new HealthcareFhirResourceType(ParametersValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Patient { get; } = new HealthcareFhirResourceType(PatientValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType PaymentNotice { get; } = new HealthcareFhirResourceType(PaymentNoticeValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType PaymentReconciliation { get; } = new HealthcareFhirResourceType(PaymentReconciliationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Person { get; } = new HealthcareFhirResourceType(PersonValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType PlanDefinition { get; } = new HealthcareFhirResourceType(PlanDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Practitioner { get; } = new HealthcareFhirResourceType(PractitionerValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType PractitionerRole { get; } = new HealthcareFhirResourceType(PractitionerRoleValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Procedure { get; } = new HealthcareFhirResourceType(ProcedureValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ProcedureRequest { get; } = new HealthcareFhirResourceType(ProcedureRequestValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ProcessRequest { get; } = new HealthcareFhirResourceType(ProcessRequestValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ProcessResponse { get; } = new HealthcareFhirResourceType(ProcessResponseValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Provenance { get; } = new HealthcareFhirResourceType(ProvenanceValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Questionnaire { get; } = new HealthcareFhirResourceType(QuestionnaireValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType QuestionnaireResponse { get; } = new HealthcareFhirResourceType(QuestionnaireResponseValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ReferralRequest { get; } = new HealthcareFhirResourceType(ReferralRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType RelatedPerson { get; } = new HealthcareFhirResourceType(RelatedPersonValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType RequestGroup { get; } = new HealthcareFhirResourceType(RequestGroupValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ResearchDefinition { get; } = new HealthcareFhirResourceType(ResearchDefinitionValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ResearchElementDefinition { get; } = new HealthcareFhirResourceType(ResearchElementDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ResearchStudy { get; } = new HealthcareFhirResourceType(ResearchStudyValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ResearchSubject { get; } = new HealthcareFhirResourceType(ResearchSubjectValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Resource { get; } = new HealthcareFhirResourceType(ResourceValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType RiskAssessment { get; } = new HealthcareFhirResourceType(RiskAssessmentValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType RiskEvidenceSynthesis { get; } = new HealthcareFhirResourceType(RiskEvidenceSynthesisValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Schedule { get; } = new HealthcareFhirResourceType(ScheduleValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType SearchParameter { get; } = new HealthcareFhirResourceType(SearchParameterValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType Sequence { get; } = new HealthcareFhirResourceType(SequenceValue); + /// The FHIR resource type defined in STU3. public static HealthcareFhirResourceType ServiceDefinition { get; } = new HealthcareFhirResourceType(ServiceDefinitionValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType ServiceRequest { get; } = new HealthcareFhirResourceType(ServiceRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Slot { get; } = new HealthcareFhirResourceType(SlotValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Specimen { get; } = new HealthcareFhirResourceType(SpecimenValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SpecimenDefinition { get; } = new HealthcareFhirResourceType(SpecimenDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType StructureDefinition { get; } = new HealthcareFhirResourceType(StructureDefinitionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType StructureMap { get; } = new HealthcareFhirResourceType(StructureMapValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Subscription { get; } = new HealthcareFhirResourceType(SubscriptionValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Substance { get; } = new HealthcareFhirResourceType(SubstanceValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SubstanceNucleicAcid { get; } = new HealthcareFhirResourceType(SubstanceNucleicAcidValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SubstancePolymer { get; } = new HealthcareFhirResourceType(SubstancePolymerValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SubstanceProtein { get; } = new HealthcareFhirResourceType(SubstanceProteinValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SubstanceReferenceInformation { get; } = new HealthcareFhirResourceType(SubstanceReferenceInformationValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SubstanceSourceMaterial { get; } = new HealthcareFhirResourceType(SubstanceSourceMaterialValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType SubstanceSpecification { get; } = new HealthcareFhirResourceType(SubstanceSpecificationValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType SupplyDelivery { get; } = new HealthcareFhirResourceType(SupplyDeliveryValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType SupplyRequest { get; } = new HealthcareFhirResourceType(SupplyRequestValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType Task { get; } = new HealthcareFhirResourceType(TaskValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType TerminologyCapabilities { get; } = new HealthcareFhirResourceType(TerminologyCapabilitiesValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType TestReport { get; } = new HealthcareFhirResourceType(TestReportValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType TestScript { get; } = new HealthcareFhirResourceType(TestScriptValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType ValueSet { get; } = new HealthcareFhirResourceType(ValueSetValue); + /// The FHIR resource type defined in R4. public static HealthcareFhirResourceType VerificationResult { get; } = new HealthcareFhirResourceType(VerificationResultValue); + /// The FHIR resource type defined in STU3 and R4. public static HealthcareFhirResourceType VisionPrescription { get; } = new HealthcareFhirResourceType(VisionPrescriptionValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(HealthcareFhirResourceType left, HealthcareFhirResourceType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(HealthcareFhirResourceType left, HealthcareFhirResourceType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator HealthcareFhirResourceType(string value) => new HealthcareFhirResourceType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator HealthcareFhirResourceType?(string value) => value == null ? null : new HealthcareFhirResourceType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is HealthcareFhirResourceType other && Equals(other); - /// + + /// public bool Equals(HealthcareFhirResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs index ab5a916195b4..f05cb5937fd8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event. [JsonConverter(typeof(HealthcareFhirResourceUpdatedEventDataConverter))] - public partial class HealthcareFhirResourceUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class HealthcareFhirResourceUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HealthcareFhirResourceUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareFhirResourceUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(FhirResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourceVersionId"u8); writer.WriteNumberValue(FhirResourceVersionId.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,75 +71,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthcareFhirResourceUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HealthcareFhirResourceUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HealthcareFhirResourceUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HealthcareFhirResourceUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHealthcareFhirResourceUpdatedEventData(document.RootElement, options); } - internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhirResourceUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhirResourceUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - HealthcareFhirResourceType? resourceType = default; - string resourceFhirAccount = default; - string resourceFhirId = default; - long? resourceVersionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + HealthcareFhirResourceType? fhirResourceType = default; + string fhirServiceHostName = default; + string fhirResourceId = default; + long? fhirResourceVersionId = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceType"u8)) + if (prop.NameEquals("resourceType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceType = new HealthcareFhirResourceType(property.Value.GetString()); + fhirResourceType = new HealthcareFhirResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("resourceFhirAccount"u8)) + if (prop.NameEquals("resourceFhirAccount"u8)) { - resourceFhirAccount = property.Value.GetString(); + fhirServiceHostName = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceFhirId"u8)) + if (prop.NameEquals("resourceFhirId"u8)) { - resourceFhirId = property.Value.GetString(); + fhirResourceId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceVersionId"u8)) + if (prop.NameEquals("resourceVersionId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceVersionId = property.Value.GetInt64(); + fhirResourceVersionId = prop.Value.GetInt64(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new HealthcareFhirResourceUpdatedEventData(resourceType, resourceFhirAccount, resourceFhirId, resourceVersionId, serializedAdditionalRawData); + return new HealthcareFhirResourceUpdatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -145,15 +155,20 @@ BinaryData IPersistableModel.Write(Model } } - HealthcareFhirResourceUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HealthcareFhirResourceUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HealthcareFhirResourceUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHealthcareFhirResourceUpdatedEventData(document.RootElement, options); } default: @@ -161,35 +176,28 @@ HealthcareFhirResourceUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static HealthcareFhirResourceUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeHealthcareFhirResourceUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class HealthcareFhirResourceUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, HealthcareFhirResourceUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override HealthcareFhirResourceUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthcareFhirResourceUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthcareFhirResourceUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs index 0dc5a17532fb..1fe46c542400 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event. public partial class HealthcareFhirResourceUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. - /// or is null. internal HealthcareFhirResourceUpdatedEventData(string fhirServiceHostName, string fhirResourceId) { - Argument.AssertNotNull(fhirServiceHostName, nameof(fhirServiceHostName)); - Argument.AssertNotNull(fhirResourceId, nameof(fhirResourceId)); - FhirServiceHostName = fhirServiceHostName; FhirResourceId = fhirResourceId; } @@ -63,27 +30,25 @@ internal HealthcareFhirResourceUpdatedEventData(string fhirServiceHostName, stri /// Domain name of FHIR account for this resource. /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). - /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary additionalBinaryDataProperties) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; FhirResourceId = fhirResourceId; FhirResourceVersionId = fhirResourceVersionId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceUpdatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Type of HL7 FHIR resource. public HealthcareFhirResourceType? FhirResourceType { get; } + /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } + /// Id of HL7 FHIR resource. public string FhirResourceId { get; } + /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). public long? FhirResourceVersionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Argument.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Argument.cs index 721be9937f1a..94752b4beb8d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Argument.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Argument.cs @@ -11,8 +11,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - internal static class Argument + internal static partial class Argument { + /// The value. + /// The name. public static void AssertNotNull(T value, string name) { if (value is null) @@ -21,8 +23,10 @@ public static void AssertNotNull(T value, string name) } } + /// The value. + /// The name. public static void AssertNotNull(T? value, string name) - where T : struct + where T : struct { if (!value.HasValue) { @@ -30,6 +34,8 @@ public static void AssertNotNull(T? value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(IEnumerable value, string name) { if (value is null) @@ -51,6 +57,8 @@ public static void AssertNotNullOrEmpty(IEnumerable value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(string value, string name) { if (value is null) @@ -62,68 +70,5 @@ public static void AssertNotNullOrEmpty(string value, string name) throw new ArgumentException("Value cannot be an empty string.", name); } } - - public static void AssertNotNullOrWhiteSpace(string value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); - } - } - - public static void AssertNotDefault(ref T value, string name) - where T : struct, IEquatable - { - if (value.Equals(default)) - { - throw new ArgumentException("Value cannot be empty.", name); - } - } - - public static void AssertInRange(T value, T minimum, T maximum, string name) - where T : notnull, IComparable - { - if (minimum.CompareTo(value) > 0) - { - throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); - } - if (maximum.CompareTo(value) < 0) - { - throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); - } - } - - public static void AssertEnumDefined(Type enumType, object value, string name) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); - } - } - - public static T CheckNotNull(T value, string name) - where T : class - { - AssertNotNull(value, name); - return value; - } - - public static string CheckNotNullOrEmpty(string value, string name) - { - AssertNotNullOrEmpty(value, name); - return value; - } - - public static void AssertNull(T value, string name, string message = null) - { - if (value != null) - { - throw new ArgumentException(message ?? "Value must be null.", name); - } - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingDictionary.cs index 89cfa4f97177..62bb8c63c432 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -11,7 +11,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary + where TKey : notnull { private IDictionary _innerDictionary; @@ -19,6 +20,7 @@ public ChangeTrackingDictionary() { } + /// The inner dictionary. public ChangeTrackingDictionary(IDictionary dictionary) { if (dictionary == null) @@ -28,6 +30,7 @@ public ChangeTrackingDictionary(IDictionary dictionary) _innerDictionary = new Dictionary(dictionary); } + /// The inner dictionary. public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) { if (dictionary == null) @@ -41,16 +44,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerDictionary == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + /// Gets the Keys. public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + /// Gets the Values. public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + /// Gets or sets the value associated with the specified key. public TValue this[TKey key] { get @@ -67,8 +76,10 @@ public TValue this[TKey key] } } + /// Gets the Keys. IEnumerable IReadOnlyDictionary.Keys => Keys; + /// Gets the Values. IEnumerable IReadOnlyDictionary.Values => Values; public IEnumerator> GetEnumerator() @@ -89,6 +100,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(KeyValuePair item) { EnsureDictionary().Add(item); @@ -99,6 +111,7 @@ public void Clear() EnsureDictionary().Clear(); } + /// The item to search for. public bool Contains(KeyValuePair item) { if (IsUndefined) @@ -108,6 +121,8 @@ public bool Contains(KeyValuePair item) return EnsureDictionary().Contains(item); } + /// The array to copy. + /// The index. public void CopyTo(KeyValuePair[] array, int index) { if (IsUndefined) @@ -117,6 +132,7 @@ public void CopyTo(KeyValuePair[] array, int index) EnsureDictionary().CopyTo(array, index); } + /// The item to remove. public bool Remove(KeyValuePair item) { if (IsUndefined) @@ -126,11 +142,14 @@ public bool Remove(KeyValuePair item) return EnsureDictionary().Remove(item); } + /// The key. + /// The value to add. public void Add(TKey key, TValue value) { EnsureDictionary().Add(key, value); } + /// The key to search for. public bool ContainsKey(TKey key) { if (IsUndefined) @@ -140,6 +159,7 @@ public bool ContainsKey(TKey key) return EnsureDictionary().ContainsKey(key); } + /// The key. public bool Remove(TKey key) { if (IsUndefined) @@ -149,6 +169,8 @@ public bool Remove(TKey key) return EnsureDictionary().Remove(key); } + /// The key to search for. + /// The value. public bool TryGetValue(TKey key, out TValue value) { if (IsUndefined) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingList.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingList.cs index 08861102824c..142545cac132 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingList.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ChangeTrackingList.cs @@ -12,7 +12,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - internal class ChangeTrackingList : IList, IReadOnlyList + internal partial class ChangeTrackingList : IList, IReadOnlyList { private IList _innerList; @@ -20,6 +20,7 @@ public ChangeTrackingList() { } + /// The inner list. public ChangeTrackingList(IList innerList) { if (innerList != null) @@ -28,6 +29,7 @@ public ChangeTrackingList(IList innerList) } } + /// The inner list. public ChangeTrackingList(IReadOnlyList innerList) { if (innerList != null) @@ -36,12 +38,16 @@ public ChangeTrackingList(IReadOnlyList innerList) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerList == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureList().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + /// Gets or sets the value associated with the specified key. public T this[int index] { get @@ -85,6 +91,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(T item) { EnsureList().Add(item); @@ -95,6 +102,7 @@ public void Clear() EnsureList().Clear(); } + /// The item. public bool Contains(T item) { if (IsUndefined) @@ -104,6 +112,8 @@ public bool Contains(T item) return EnsureList().Contains(item); } + /// The array to copy to. + /// The array index. public void CopyTo(T[] array, int arrayIndex) { if (IsUndefined) @@ -113,6 +123,7 @@ public void CopyTo(T[] array, int arrayIndex) EnsureList().CopyTo(array, arrayIndex); } + /// The item. public bool Remove(T item) { if (IsUndefined) @@ -122,6 +133,7 @@ public bool Remove(T item) return EnsureList().Remove(item); } + /// The item. public int IndexOf(T item) { if (IsUndefined) @@ -131,11 +143,14 @@ public int IndexOf(T item) return EnsureList().IndexOf(item); } + /// The inner list. + /// The item. public void Insert(int index, T item) { EnsureList().Insert(index, item); } + /// The inner list. public void RemoveAt(int index) { if (IsUndefined) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..57b48e59c306 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + /// The original name of the member. + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..3b75b8f69e7f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + /// The property name which these hooks apply to. + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + /// The property name which these hooks apply to. + /// The serialization name of the property. + public CodeGenSerializationAttribute(string propertyName, string propertySerializationName) + { + PropertyName = propertyName; + PropertySerializationName = propertySerializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string PropertySerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..02bee5978c18 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + /// The member to suppress. + /// The types of the parameters of the member. + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..b01aee340b0d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + /// The original name of the type. + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ModelSerializationExtensions.cs index 16b7cd131dcd..4ed25bed5ce9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/ModelSerializationExtensions.cs @@ -11,18 +11,16 @@ using System.Diagnostics; using System.Globalization; using System.Text.Json; -using System.Xml; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - internal static class ModelSerializationExtensions + internal static partial class ModelSerializationExtensions { - internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); - internal static readonly ModelReaderWriterOptions WireV3Options = new ModelReaderWriterOptions("W|v3"); - internal static readonly ModelReaderWriterOptions JsonV3Options = new ModelReaderWriterOptions("J|v3"); - internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions + { + MaxDepth = 256 + }; public static object GetObject(this JsonElement element) { @@ -48,14 +46,14 @@ public static object GetObject(this JsonElement element) case JsonValueKind.Null: return null; case JsonValueKind.Object: - var dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var jsonProperty in element.EnumerateObject()) { dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); } return dictionary; case JsonValueKind.Array: - var list = new List(); + List list = new List(); foreach (var item in element.EnumerateArray()) { list.Add(item.GetObject()); @@ -93,7 +91,7 @@ public static char GetChar(this JsonElement element) { if (element.ValueKind == JsonValueKind.String) { - var text = element.GetString(); + string text = element.GetString(); if (text == null || text.Length != 1) { throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); @@ -107,14 +105,14 @@ public static char GetChar(this JsonElement element) } [Conditional("DEBUG")] - public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + public static void ThrowNonNullablePropertyIsNull(this JsonProperty @property) { - throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + throw new JsonException($"A property '{@property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); } public static string GetRequiredString(this JsonElement element) { - var value = element.GetString(); + string value = element.GetString(); if (value == null) { throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); @@ -181,9 +179,6 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, T value, Mode case IJsonModel jsonModel: jsonModel.Write(writer, options ?? WireOptions); break; - case IUtf8JsonSerializable serializable: - serializable.Write(writer); - break; case byte[] bytes: writer.WriteBase64StringValue(bytes); break; @@ -259,151 +254,5 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo { writer.WriteObjectValue(value, options); } - - internal static bool IsSentinelValue(BinaryData value) - { - ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; - ReadOnlySpan valueSpan = value.ToMemory().Span; - return sentinelSpan.SequenceEqual(valueSpan); - } - - internal static class TypeFormatters - { - private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; - public const string DefaultNumberFormat = "G"; - - public static string ToString(bool value) => value ? "true" : "false"; - - public static string ToString(DateTime value, string format) => value.Kind switch - { - DateTimeKind.Utc => ToString((DateTimeOffset)value, format), - _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") - }; - - public static string ToString(DateTimeOffset value, string format) => format switch - { - "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), - "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), - "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "R" => value.ToString("r", CultureInfo.InvariantCulture), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(TimeSpan value, string format) => format switch - { - "P" => XmlConvert.ToString(value), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(byte[] value, string format) => format switch - { - "U" => ToBase64UrlString(value), - "D" => Convert.ToBase64String(value), - _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) - }; - - public static string ToBase64UrlString(byte[] value) - { - int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; - int size = checked(numWholeOrPartialInputBlocks * 4); - char[] output = new char[size]; - - int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); - - int i = 0; - for (; i < numBase64Chars; i++) - { - char ch = output[i]; - if (ch == '+') - { - output[i] = '-'; - } - else - { - if (ch == '/') - { - output[i] = '_'; - } - else - { - if (ch == '=') - { - break; - } - } - } - } - - return new string(output, 0, i); - } - - public static byte[] FromBase64UrlString(string value) - { - int paddingCharsToAdd = (value.Length % 4) switch - { - 0 => 0, - 2 => 2, - 3 => 1, - _ => throw new InvalidOperationException("Malformed input") - }; - char[] output = new char[(value.Length + paddingCharsToAdd)]; - int i = 0; - for (; i < value.Length; i++) - { - char ch = value[i]; - if (ch == '-') - { - output[i] = '+'; - } - else - { - if (ch == '_') - { - output[i] = '/'; - } - else - { - output[i] = ch; - } - } - } - - for (; i < output.Length; i++) - { - output[i] = '='; - } - - return Convert.FromBase64CharArray(output, 0, output.Length); - } - - public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch - { - "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), - _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) - }; - - public static TimeSpan ParseTimeSpan(string value, string format) => format switch - { - "P" => XmlConvert.ToTimeSpan(value), - _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) - }; - - public static string ConvertToString(object value, string format = null) => value switch - { - null => "null", - string s => s, - bool b => ToString(b), - int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), - byte[] b0 when format != null => ToString(b0, format), - IEnumerable s0 => string.Join(",", s0), - DateTimeOffset dateTime when format != null => ToString(dateTime, format), - TimeSpan timeSpan when format != null => ToString(timeSpan, format), - TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), - Guid guid => guid.ToString(), - BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), - _ => value.ToString() - }; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Optional.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Optional.cs index 0c812e3a4640..b6135c97f4b3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Optional.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Optional.cs @@ -10,7 +10,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - internal static class Optional + internal static partial class Optional { public static bool IsCollectionDefined(IEnumerable collection) { @@ -28,7 +28,7 @@ public static bool IsCollectionDefined(IReadOnlyDictionary(T? value) - where T : struct + where T : struct { return value.HasValue; } @@ -38,14 +38,14 @@ public static bool IsDefined(object value) return value != null; } - public static bool IsDefined(JsonElement value) + public static bool IsDefined(string value) { - return value.ValueKind != JsonValueKind.Undefined; + return value != null; } - public static bool IsDefined(string value) + public static bool IsDefined(JsonElement value) { - return value != null; + return value.ValueKind != JsonValueKind.Undefined; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/TypeFormatters.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000000..a41b19a89067 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/TypeFormatters.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + internal static partial class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Generated clients require it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => System.Xml.XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked (value.Length + 2) / 3; + int size = checked (numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => System.Xml.XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => System.Xml.XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Utf8JsonRequestContent.cs deleted file mode 100644 index 94cc4cc536d5..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Internal/Utf8JsonRequestContent.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.IO; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - internal class Utf8JsonRequestContent : RequestContent - { - private readonly MemoryStream _stream; - private readonly RequestContent _content; - - public Utf8JsonRequestContent() - { - _stream = new MemoryStream(); - _content = Create(_stream); - JsonWriter = new Utf8JsonWriter(_stream); - } - - public Utf8JsonWriter JsonWriter { get; } - - public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) - { - await JsonWriter.FlushAsync().ConfigureAwait(false); - await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); - } - - public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) - { - JsonWriter.Flush(); - _content.WriteTo(stream, cancellationToken); - } - - public override bool TryComputeLength(out long length) - { - length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; - return true; - } - - public override void Dispose() - { - JsonWriter.Dispose(); - _content.Dispose(); - _stream.Dispose(); - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.Serialization.cs index 7a6156ab7809..bca7d63ce104 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.Devices.DeviceConnected event. [JsonConverter(typeof(IotHubDeviceConnectedEventDataConverter))] - public partial class IotHubDeviceConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class IotHubDeviceConnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal IotHubDeviceConnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceConnectedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - IotHubDeviceConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + IotHubDeviceConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (IotHubDeviceConnectedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override DeviceConnectionStateEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceConnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeIotHubDeviceConnectedEventData(document.RootElement, options); } - internal static IotHubDeviceConnectedEventData DeserializeIotHubDeviceConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static IotHubDeviceConnectedEventData DeserializeIotHubDeviceConnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,43 +72,44 @@ internal static IotHubDeviceConnectedEventData DeserializeIotHubDeviceConnectedE string moduleId = default; string hubName = default; DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("moduleId"u8)) + if (prop.NameEquals("moduleId"u8)) { - moduleId = property.Value.GetString(); + moduleId = prop.Value.GetString(); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("deviceConnectionStateEventInfo"u8)) + if (prop.NameEquals("deviceConnectionStateEventInfo"u8)) { - deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEventInfo(property.Value, options); + deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEventInfo(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new IotHubDeviceConnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData); + return new IotHubDeviceConnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -109,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - IotHubDeviceConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + IotHubDeviceConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (IotHubDeviceConnectedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override DeviceConnectionStateEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeIotHubDeviceConnectedEventData(document.RootElement, options); } default: @@ -125,35 +140,28 @@ IotHubDeviceConnectedEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new IotHubDeviceConnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIotHubDeviceConnectedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class IotHubDeviceConnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, IotHubDeviceConnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override IotHubDeviceConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeIotHubDeviceConnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceConnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.cs index f94cca1d08ef..0628a0fae87e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.cs @@ -17,12 +17,8 @@ public partial class IotHubDeviceConnectedEventData : DeviceConnectionStateEvent /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. - /// , or is null. internal IotHubDeviceConnectedEventData(string deviceId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) : base(deviceId, hubName, deviceConnectionStateEventInfo) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(deviceConnectionStateEventInfo, nameof(deviceConnectionStateEventInfo)); } /// Initializes a new instance of . @@ -30,13 +26,8 @@ internal IotHubDeviceConnectedEventData(string deviceId, string hubName, DeviceC /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. - /// Keeps track of any properties unknown to the library. - internal IotHubDeviceConnectedEventData(string deviceId, string moduleId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo, IDictionary serializedAdditionalRawData) : base(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal IotHubDeviceConnectedEventData() + /// Keeps track of any properties unknown to the library. + internal IotHubDeviceConnectedEventData(string deviceId, string moduleId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo, IDictionary additionalBinaryDataProperties) : base(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.Serialization.cs index cfdc0eb2e338..4e9dd493a865 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.Devices.DeviceCreated event. [JsonConverter(typeof(IotHubDeviceCreatedEventDataConverter))] - public partial class IotHubDeviceCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class IotHubDeviceCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal IotHubDeviceCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceCreatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - IotHubDeviceCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + IotHubDeviceCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (IotHubDeviceCreatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override DeviceLifeCycleEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeIotHubDeviceCreatedEventData(document.RootElement, options); } - internal static IotHubDeviceCreatedEventData DeserializeIotHubDeviceCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static IotHubDeviceCreatedEventData DeserializeIotHubDeviceCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -62,38 +71,39 @@ internal static IotHubDeviceCreatedEventData DeserializeIotHubDeviceCreatedEvent string deviceId = default; string hubName = default; DeviceTwinInfo twin = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("twin"u8)) + if (prop.NameEquals("twin"u8)) { - twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(property.Value, options); + twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new IotHubDeviceCreatedEventData(deviceId, hubName, twin, serializedAdditionalRawData); + return new IotHubDeviceCreatedEventData(deviceId, hubName, twin, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +113,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - IotHubDeviceCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + IotHubDeviceCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (IotHubDeviceCreatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override DeviceLifeCycleEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeIotHubDeviceCreatedEventData(document.RootElement, options); } default: @@ -119,35 +134,28 @@ IotHubDeviceCreatedEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new IotHubDeviceCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIotHubDeviceCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class IotHubDeviceCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, IotHubDeviceCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override IotHubDeviceCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeIotHubDeviceCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.cs index b2e7faff176b..efdc3d30a1b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.cs @@ -17,25 +17,16 @@ public partial class IotHubDeviceCreatedEventData : DeviceLifeCycleEventProperti /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. - /// , or is null. internal IotHubDeviceCreatedEventData(string deviceId, string hubName, DeviceTwinInfo twin) : base(deviceId, hubName, twin) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(twin, nameof(twin)); } /// Initializes a new instance of . /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. - /// Keeps track of any properties unknown to the library. - internal IotHubDeviceCreatedEventData(string deviceId, string hubName, DeviceTwinInfo twin, IDictionary serializedAdditionalRawData) : base(deviceId, hubName, twin, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal IotHubDeviceCreatedEventData() + /// Keeps track of any properties unknown to the library. + internal IotHubDeviceCreatedEventData(string deviceId, string hubName, DeviceTwinInfo twin, IDictionary additionalBinaryDataProperties) : base(deviceId, hubName, twin, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.Serialization.cs index fd5ec3e67e81..7fba3a4791d3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.Devices.DeviceDeleted event. [JsonConverter(typeof(IotHubDeviceDeletedEventDataConverter))] - public partial class IotHubDeviceDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class IotHubDeviceDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal IotHubDeviceDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - IotHubDeviceDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + IotHubDeviceDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (IotHubDeviceDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override DeviceLifeCycleEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeIotHubDeviceDeletedEventData(document.RootElement, options); } - internal static IotHubDeviceDeletedEventData DeserializeIotHubDeviceDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static IotHubDeviceDeletedEventData DeserializeIotHubDeviceDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -62,38 +71,39 @@ internal static IotHubDeviceDeletedEventData DeserializeIotHubDeviceDeletedEvent string deviceId = default; string hubName = default; DeviceTwinInfo twin = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("twin"u8)) + if (prop.NameEquals("twin"u8)) { - twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(property.Value, options); + twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new IotHubDeviceDeletedEventData(deviceId, hubName, twin, serializedAdditionalRawData); + return new IotHubDeviceDeletedEventData(deviceId, hubName, twin, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +113,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - IotHubDeviceDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + IotHubDeviceDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (IotHubDeviceDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override DeviceLifeCycleEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeIotHubDeviceDeletedEventData(document.RootElement, options); } default: @@ -119,35 +134,28 @@ IotHubDeviceDeletedEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new IotHubDeviceDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIotHubDeviceDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class IotHubDeviceDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, IotHubDeviceDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override IotHubDeviceDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeIotHubDeviceDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.cs index 6226a6094009..7a9e5ddb0e65 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.cs @@ -17,25 +17,16 @@ public partial class IotHubDeviceDeletedEventData : DeviceLifeCycleEventProperti /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. - /// , or is null. internal IotHubDeviceDeletedEventData(string deviceId, string hubName, DeviceTwinInfo twin) : base(deviceId, hubName, twin) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(twin, nameof(twin)); } /// Initializes a new instance of . /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device twin, which is the cloud representation of application device metadata. - /// Keeps track of any properties unknown to the library. - internal IotHubDeviceDeletedEventData(string deviceId, string hubName, DeviceTwinInfo twin, IDictionary serializedAdditionalRawData) : base(deviceId, hubName, twin, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal IotHubDeviceDeletedEventData() + /// Keeps track of any properties unknown to the library. + internal IotHubDeviceDeletedEventData(string deviceId, string hubName, DeviceTwinInfo twin, IDictionary additionalBinaryDataProperties) : base(deviceId, hubName, twin, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.Serialization.cs index 8fdb3a619f41..ffb5a148139e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.Devices.DeviceDisconnected event. [JsonConverter(typeof(IotHubDeviceDisconnectedEventDataConverter))] - public partial class IotHubDeviceDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class IotHubDeviceDisconnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal IotHubDeviceDisconnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +35,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceDisconnectedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - IotHubDeviceDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + IotHubDeviceDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (IotHubDeviceDisconnectedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override DeviceConnectionStateEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceDisconnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeIotHubDeviceDisconnectedEventData(document.RootElement, options); } - internal static IotHubDeviceDisconnectedEventData DeserializeIotHubDeviceDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static IotHubDeviceDisconnectedEventData DeserializeIotHubDeviceDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,43 +72,44 @@ internal static IotHubDeviceDisconnectedEventData DeserializeIotHubDeviceDisconn string moduleId = default; string hubName = default; DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("moduleId"u8)) + if (prop.NameEquals("moduleId"u8)) { - moduleId = property.Value.GetString(); + moduleId = prop.Value.GetString(); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("deviceConnectionStateEventInfo"u8)) + if (prop.NameEquals("deviceConnectionStateEventInfo"u8)) { - deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEventInfo(property.Value, options); + deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEventInfo(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new IotHubDeviceDisconnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData); + return new IotHubDeviceDisconnectedEventData(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -109,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - IotHubDeviceDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + IotHubDeviceDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (IotHubDeviceDisconnectedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override DeviceConnectionStateEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeIotHubDeviceDisconnectedEventData(document.RootElement, options); } default: @@ -125,35 +140,28 @@ IotHubDeviceDisconnectedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new IotHubDeviceDisconnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIotHubDeviceDisconnectedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class IotHubDeviceDisconnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, IotHubDeviceDisconnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override IotHubDeviceDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeIotHubDeviceDisconnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceDisconnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.cs index ca74eb38c106..cceb54d0f1ad 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.cs @@ -17,12 +17,8 @@ public partial class IotHubDeviceDisconnectedEventData : DeviceConnectionStateEv /// The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. - /// , or is null. internal IotHubDeviceDisconnectedEventData(string deviceId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) : base(deviceId, hubName, deviceConnectionStateEventInfo) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(deviceConnectionStateEventInfo, nameof(deviceConnectionStateEventInfo)); } /// Initializes a new instance of . @@ -30,13 +26,8 @@ internal IotHubDeviceDisconnectedEventData(string deviceId, string hubName, Devi /// The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '. /// Name of the IoT Hub where the device was created or deleted. /// Information about the device connection state event. - /// Keeps track of any properties unknown to the library. - internal IotHubDeviceDisconnectedEventData(string deviceId, string moduleId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo, IDictionary serializedAdditionalRawData) : base(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal IotHubDeviceDisconnectedEventData() + /// Keeps track of any properties unknown to the library. + internal IotHubDeviceDisconnectedEventData(string deviceId, string moduleId, string hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo, IDictionary additionalBinaryDataProperties) : base(deviceId, moduleId, hubName, deviceConnectionStateEventInfo, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs index 9aae64bb1157..69840086bae0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Event data for Microsoft.Devices.DeviceTelemetry event. [JsonConverter(typeof(IotHubDeviceTelemetryEventDataConverter))] - public partial class IotHubDeviceTelemetryEventData : IUtf8JsonSerializable, IJsonModel + public partial class IotHubDeviceTelemetryEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal IotHubDeviceTelemetryEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,80 +35,99 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceTelemetryEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - IotHubDeviceTelemetryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + IotHubDeviceTelemetryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (IotHubDeviceTelemetryEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override DeviceTelemetryEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(IotHubDeviceTelemetryEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeIotHubDeviceTelemetryEventData(document.RootElement, options); } - internal static IotHubDeviceTelemetryEventData DeserializeIotHubDeviceTelemetryEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static IotHubDeviceTelemetryEventData DeserializeIotHubDeviceTelemetryEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } object body = default; - IReadOnlyDictionary properties = default; - IReadOnlyDictionary systemProperties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary properties = default; + IDictionary systemProperties = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("body"u8)) + if (prop.NameEquals("body"u8)) { - body = property.Value.GetObject(); + body = prop.Value.GetObject(); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } properties = dictionary; continue; } - if (property.NameEquals("systemProperties"u8)) + if (prop.NameEquals("systemProperties"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } systemProperties = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new IotHubDeviceTelemetryEventData(body, properties, systemProperties, serializedAdditionalRawData); + return new IotHubDeviceTelemetryEventData(body, properties, systemProperties, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +137,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - IotHubDeviceTelemetryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + IotHubDeviceTelemetryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (IotHubDeviceTelemetryEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override DeviceTelemetryEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeIotHubDeviceTelemetryEventData(document.RootElement, options); } default: @@ -129,35 +158,28 @@ IotHubDeviceTelemetryEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new IotHubDeviceTelemetryEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeIotHubDeviceTelemetryEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class IotHubDeviceTelemetryEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, IotHubDeviceTelemetryEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override IotHubDeviceTelemetryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeIotHubDeviceTelemetryEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceTelemetryEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs index d1dc62865f7e..3d630cfaa9a0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs @@ -17,25 +17,16 @@ public partial class IotHubDeviceTelemetryEventData : DeviceTelemetryEventProper /// The content of the message from the device. /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. - /// , or is null. - internal IotHubDeviceTelemetryEventData(object body, IReadOnlyDictionary properties, IReadOnlyDictionary systemProperties) : base(body, properties, systemProperties) + internal IotHubDeviceTelemetryEventData(object body, IDictionary properties, IDictionary systemProperties) : base(body, properties, systemProperties) { - Argument.AssertNotNull(body, nameof(body)); - Argument.AssertNotNull(properties, nameof(properties)); - Argument.AssertNotNull(systemProperties, nameof(systemProperties)); } /// Initializes a new instance of . /// The content of the message from the device. /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. - /// Keeps track of any properties unknown to the library. - internal IotHubDeviceTelemetryEventData(object body, IReadOnlyDictionary properties, IReadOnlyDictionary systemProperties, IDictionary serializedAdditionalRawData) : base(body, properties, systemProperties, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal IotHubDeviceTelemetryEventData() + /// Keeps track of any properties unknown to the library. + internal IotHubDeviceTelemetryEventData(object body, IDictionary properties, IDictionary systemProperties, IDictionary additionalBinaryDataProperties) : base(body, properties, systemProperties, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.Serialization.cs index 7fcf052008f4..c14eca48b2fe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event. [JsonConverter(typeof(KeyVaultAccessPolicyChangedEventDataConverter))] - public partial class KeyVaultAccessPolicyChangedEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultAccessPolicyChangedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultAccessPolicyChangedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultAccessPolicyChangedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultAccessPolicyChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultAccessPolicyChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultAccessPolicyChangedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultAccessPolicyChangedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultAccessPolicyChangedEventData(document.RootElement, options); } - internal static KeyVaultAccessPolicyChangedEventData DeserializeKeyVaultAccessPolicyChangedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultAccessPolicyChangedEventData DeserializeKeyVaultAccessPolicyChangedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultAccessPolicyChangedEventData DeserializeKeyVaultAccessPo string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultAccessPolicyChangedEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultAccessPolicyChangedEventData DeserializeKeyVaultAccessPo version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - KeyVaultAccessPolicyChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultAccessPolicyChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultAccessPolicyChangedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultAccessPolicyChangedEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultAccessPolicyChangedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultAccessPolicyChangedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultAccessPolicyChangedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultAccessPolicyChangedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultAccessPolicyChangedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultAccessPolicyChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultAccessPolicyChangedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultAccessPolicyChangedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.cs index 80395cbb9e99..9726fe0cae7e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event. public partial class KeyVaultAccessPolicyChangedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultAccessPolicyChangedEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultAccessPolicyChangedEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultAccessPolicyChangedEventData(string id, string vaultName, strin /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultAccessPolicyChangedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultAccessPolicyChangedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultAccessPolicyChangedEventData(string id, string vaultName, strin Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultAccessPolicyChangedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.Serialization.cs index 3b9f9ba4285c..4f3757ef13d7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event. [JsonConverter(typeof(KeyVaultCertificateExpiredEventDataConverter))] - public partial class KeyVaultCertificateExpiredEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultCertificateExpiredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultCertificateExpiredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultCertificateExpiredEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultCertificateExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultCertificateExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultCertificateExpiredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultCertificateExpiredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultCertificateExpiredEventData(document.RootElement, options); } - internal static KeyVaultCertificateExpiredEventData DeserializeKeyVaultCertificateExpiredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultCertificateExpiredEventData DeserializeKeyVaultCertificateExpiredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultCertificateExpiredEventData DeserializeKeyVaultCertifica string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultCertificateExpiredEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultCertificateExpiredEventData DeserializeKeyVaultCertifica version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - KeyVaultCertificateExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultCertificateExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultCertificateExpiredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultCertificateExpiredEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultCertificateExpiredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultCertificateExpiredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultCertificateExpiredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultCertificateExpiredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultCertificateExpiredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultCertificateExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultCertificateExpiredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCertificateExpiredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.cs index bd0cf1898f8e..c58f16c7bba2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event. public partial class KeyVaultCertificateExpiredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultCertificateExpiredEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultCertificateExpiredEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultCertificateExpiredEventData(string id, string vaultName, string /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultCertificateExpiredEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultCertificateExpiredEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultCertificateExpiredEventData(string id, string vaultName, string Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultCertificateExpiredEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.Serialization.cs index 7fa3d6f1bc8f..06d152a1b341 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event. [JsonConverter(typeof(KeyVaultCertificateNearExpiryEventDataConverter))] - public partial class KeyVaultCertificateNearExpiryEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultCertificateNearExpiryEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultCertificateNearExpiryEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultCertificateNearExpiryEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultCertificateNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultCertificateNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultCertificateNearExpiryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultCertificateNearExpiryEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultCertificateNearExpiryEventData(document.RootElement, options); } - internal static KeyVaultCertificateNearExpiryEventData DeserializeKeyVaultCertificateNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultCertificateNearExpiryEventData DeserializeKeyVaultCertificateNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultCertificateNearExpiryEventData DeserializeKeyVaultCertif string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultCertificateNearExpiryEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultCertificateNearExpiryEventData DeserializeKeyVaultCertif version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(Model } } - KeyVaultCertificateNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultCertificateNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultCertificateNearExpiryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultCertificateNearExpiryEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultCertificateNearExpiryEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultCertificateNearExpiryEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultCertificateNearExpiryEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultCertificateNearExpiryEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultCertificateNearExpiryEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultCertificateNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultCertificateNearExpiryEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCertificateNearExpiryEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.cs index 700e0ef075a8..ec7c5a7d33b1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event. public partial class KeyVaultCertificateNearExpiryEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultCertificateNearExpiryEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultCertificateNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultCertificateNearExpiryEventData(string id, string vaultName, str /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultCertificateNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultCertificateNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultCertificateNearExpiryEventData(string id, string vaultName, str Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultCertificateNearExpiryEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs index 094f5bd398cd..c1785bf21773 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event. [JsonConverter(typeof(KeyVaultCertificateNewVersionCreatedEventDataConverter))] - public partial class KeyVaultCertificateNewVersionCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultCertificateNewVersionCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultCertificateNewVersionCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultCertificateNewVersionCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultCertificateNewVersionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultCertificateNewVersionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultCertificateNewVersionCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultCertificateNewVersionCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultCertificateNewVersionCreatedEventData(document.RootElement, options); } - internal static KeyVaultCertificateNewVersionCreatedEventData DeserializeKeyVaultCertificateNewVersionCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultCertificateNewVersionCreatedEventData DeserializeKeyVaultCertificateNewVersionCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultCertificateNewVersionCreatedEventData DeserializeKeyVaul string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultCertificateNewVersionCreatedEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultCertificateNewVersionCreatedEventData DeserializeKeyVaul version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Writ } } - KeyVaultCertificateNewVersionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultCertificateNewVersionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultCertificateNewVersionCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultCertificateNewVersionCreatedEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultCertificateNewVersionCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultCertificateNewVersionCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultCertificateNewVersionCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultCertificateNewVersionCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultCertificateNewVersionCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultCertificateNewVersionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultCertificateNewVersionCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCertificateNewVersionCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.cs index af1f97159e7f..5ea2a7eed07e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event. public partial class KeyVaultCertificateNewVersionCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultCertificateNewVersionCreatedEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultCertificateNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultCertificateNewVersionCreatedEventData(string id, string vaultNa /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultCertificateNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultCertificateNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultCertificateNewVersionCreatedEventData(string id, string vaultNa Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultCertificateNewVersionCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.Serialization.cs index 38aa6bbaf89d..1bcd25409889 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event. [JsonConverter(typeof(KeyVaultKeyExpiredEventDataConverter))] - public partial class KeyVaultKeyExpiredEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultKeyExpiredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultKeyExpiredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultKeyExpiredEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultKeyExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultKeyExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultKeyExpiredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultKeyExpiredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultKeyExpiredEventData(document.RootElement, options); } - internal static KeyVaultKeyExpiredEventData DeserializeKeyVaultKeyExpiredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultKeyExpiredEventData DeserializeKeyVaultKeyExpiredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultKeyExpiredEventData DeserializeKeyVaultKeyExpiredEventDa string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultKeyExpiredEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultKeyExpiredEventData DeserializeKeyVaultKeyExpiredEventDa version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - KeyVaultKeyExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultKeyExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultKeyExpiredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultKeyExpiredEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultKeyExpiredEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultKeyExpiredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultKeyExpiredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultKeyExpiredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultKeyExpiredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultKeyExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultKeyExpiredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultKeyExpiredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.cs index 32e42f0ee8ee..fc58c458aaff 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event. public partial class KeyVaultKeyExpiredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultKeyExpiredEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultKeyExpiredEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultKeyExpiredEventData(string id, string vaultName, string objectT /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultKeyExpiredEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultKeyExpiredEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultKeyExpiredEventData(string id, string vaultName, string objectT Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultKeyExpiredEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.Serialization.cs index e3ba6e92cdf4..72f3717c8eb4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event. [JsonConverter(typeof(KeyVaultKeyNearExpiryEventDataConverter))] - public partial class KeyVaultKeyNearExpiryEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultKeyNearExpiryEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultKeyNearExpiryEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultKeyNearExpiryEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultKeyNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultKeyNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultKeyNearExpiryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultKeyNearExpiryEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultKeyNearExpiryEventData(document.RootElement, options); } - internal static KeyVaultKeyNearExpiryEventData DeserializeKeyVaultKeyNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultKeyNearExpiryEventData DeserializeKeyVaultKeyNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultKeyNearExpiryEventData DeserializeKeyVaultKeyNearExpiryE string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultKeyNearExpiryEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultKeyNearExpiryEventData DeserializeKeyVaultKeyNearExpiryE version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - KeyVaultKeyNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultKeyNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultKeyNearExpiryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultKeyNearExpiryEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultKeyNearExpiryEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultKeyNearExpiryEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultKeyNearExpiryEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultKeyNearExpiryEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultKeyNearExpiryEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultKeyNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultKeyNearExpiryEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultKeyNearExpiryEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.cs index 22bedc88b7b7..3b02734060fb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event. public partial class KeyVaultKeyNearExpiryEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultKeyNearExpiryEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultKeyNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultKeyNearExpiryEventData(string id, string vaultName, string obje /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultKeyNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultKeyNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultKeyNearExpiryEventData(string id, string vaultName, string obje Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultKeyNearExpiryEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs index 5dc616e31d81..d2f8fea1993d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event. [JsonConverter(typeof(KeyVaultKeyNewVersionCreatedEventDataConverter))] - public partial class KeyVaultKeyNewVersionCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultKeyNewVersionCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultKeyNewVersionCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultKeyNewVersionCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultKeyNewVersionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultKeyNewVersionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultKeyNewVersionCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultKeyNewVersionCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultKeyNewVersionCreatedEventData(document.RootElement, options); } - internal static KeyVaultKeyNewVersionCreatedEventData DeserializeKeyVaultKeyNewVersionCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultKeyNewVersionCreatedEventData DeserializeKeyVaultKeyNewVersionCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultKeyNewVersionCreatedEventData DeserializeKeyVaultKeyNewV string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultKeyNewVersionCreatedEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultKeyNewVersionCreatedEventData DeserializeKeyVaultKeyNewV version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelR } } - KeyVaultKeyNewVersionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultKeyNewVersionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultKeyNewVersionCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultKeyNewVersionCreatedEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultKeyNewVersionCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultKeyNewVersionCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultKeyNewVersionCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultKeyNewVersionCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultKeyNewVersionCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultKeyNewVersionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultKeyNewVersionCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultKeyNewVersionCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.cs index f4e4246d3f1c..e95790d1128c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event. public partial class KeyVaultKeyNewVersionCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultKeyNewVersionCreatedEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultKeyNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultKeyNewVersionCreatedEventData(string id, string vaultName, stri /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultKeyNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultKeyNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultKeyNewVersionCreatedEventData(string id, string vaultName, stri Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultKeyNewVersionCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.Serialization.cs index 0245876db78f..1cb80dadcab8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event. [JsonConverter(typeof(KeyVaultSecretExpiredEventDataConverter))] - public partial class KeyVaultSecretExpiredEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultSecretExpiredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultSecretExpiredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultSecretExpiredEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultSecretExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultSecretExpiredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultSecretExpiredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultSecretExpiredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultSecretExpiredEventData(document.RootElement, options); } - internal static KeyVaultSecretExpiredEventData DeserializeKeyVaultSecretExpiredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultSecretExpiredEventData DeserializeKeyVaultSecretExpiredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultSecretExpiredEventData DeserializeKeyVaultSecretExpiredE string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultSecretExpiredEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultSecretExpiredEventData DeserializeKeyVaultSecretExpiredE version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - KeyVaultSecretExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultSecretExpiredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultSecretExpiredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultSecretExpiredEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultSecretExpiredEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultSecretExpiredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultSecretExpiredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultSecretExpiredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultSecretExpiredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultSecretExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultSecretExpiredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretExpiredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.cs index 0b29fb937d48..df87a418a389 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event. public partial class KeyVaultSecretExpiredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultSecretExpiredEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultSecretExpiredEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultSecretExpiredEventData(string id, string vaultName, string obje /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultSecretExpiredEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultSecretExpiredEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultSecretExpiredEventData(string id, string vaultName, string obje Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultSecretExpiredEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.Serialization.cs index b8c9afeb19e6..3ba9efd6e86d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event. [JsonConverter(typeof(KeyVaultSecretNearExpiryEventDataConverter))] - public partial class KeyVaultSecretNearExpiryEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultSecretNearExpiryEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultSecretNearExpiryEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultSecretNearExpiryEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultSecretNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultSecretNearExpiryEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultSecretNearExpiryEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultSecretNearExpiryEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultSecretNearExpiryEventData(document.RootElement, options); } - internal static KeyVaultSecretNearExpiryEventData DeserializeKeyVaultSecretNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultSecretNearExpiryEventData DeserializeKeyVaultSecretNearExpiryEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultSecretNearExpiryEventData DeserializeKeyVaultSecretNearE string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultSecretNearExpiryEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultSecretNearExpiryEventData DeserializeKeyVaultSecretNearE version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - KeyVaultSecretNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultSecretNearExpiryEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultSecretNearExpiryEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultSecretNearExpiryEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultSecretNearExpiryEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultSecretNearExpiryEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultSecretNearExpiryEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultSecretNearExpiryEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultSecretNearExpiryEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultSecretNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultSecretNearExpiryEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretNearExpiryEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.cs index af0512a032b0..1023957ed8aa 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event. public partial class KeyVaultSecretNearExpiryEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultSecretNearExpiryEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultSecretNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultSecretNearExpiryEventData(string id, string vaultName, string o /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultSecretNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultSecretNearExpiryEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultSecretNearExpiryEventData(string id, string vaultName, string o Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultSecretNearExpiryEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs index 9e3f5d839e28..f3e46cf88175 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event. [JsonConverter(typeof(KeyVaultSecretNewVersionCreatedEventDataConverter))] - public partial class KeyVaultSecretNewVersionCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultSecretNewVersionCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal KeyVaultSecretNewVersionCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultSecretNewVersionCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("Id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("VaultName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("EXP"u8); writer.WriteNumberValue(Exp.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - KeyVaultSecretNewVersionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + KeyVaultSecretNewVersionCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual KeyVaultSecretNewVersionCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(KeyVaultSecretNewVersionCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeKeyVaultSecretNewVersionCreatedEventData(document.RootElement, options); } - internal static KeyVaultSecretNewVersionCreatedEventData DeserializeKeyVaultSecretNewVersionCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static KeyVaultSecretNewVersionCreatedEventData DeserializeKeyVaultSecretNewVersionCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static KeyVaultSecretNewVersionCreatedEventData DeserializeKeyVaultSecr string version = default; float? nbf = default; float? exp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("Id"u8)) + if (prop.NameEquals("Id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("VaultName"u8)) + if (prop.NameEquals("VaultName"u8)) { - vaultName = property.Value.GetString(); + vaultName = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectType"u8)) + if (prop.NameEquals("ObjectType"u8)) { - objectType = property.Value.GetString(); + objectType = prop.Value.GetString(); continue; } - if (property.NameEquals("ObjectName"u8)) + if (prop.NameEquals("ObjectName"u8)) { - objectName = property.Value.GetString(); + objectName = prop.Value.GetString(); continue; } - if (property.NameEquals("Version"u8)) + if (prop.NameEquals("Version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("NBF"u8)) + if (prop.NameEquals("NBF"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nbf = property.Value.GetSingle(); + nbf = prop.Value.GetSingle(); continue; } - if (property.NameEquals("EXP"u8)) + if (prop.NameEquals("EXP"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - exp = property.Value.GetSingle(); + exp = prop.Value.GetSingle(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new KeyVaultSecretNewVersionCreatedEventData( id, vaultName, @@ -161,13 +168,16 @@ internal static KeyVaultSecretNewVersionCreatedEventData DeserializeKeyVaultSecr version, nbf, exp, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.Write(Mod } } - KeyVaultSecretNewVersionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + KeyVaultSecretNewVersionCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual KeyVaultSecretNewVersionCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeKeyVaultSecretNewVersionCreatedEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ KeyVaultSecretNewVersionCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static KeyVaultSecretNewVersionCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeKeyVaultSecretNewVersionCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class KeyVaultSecretNewVersionCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, KeyVaultSecretNewVersionCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override KeyVaultSecretNewVersionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeKeyVaultSecretNewVersionCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretNewVersionCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.cs index d42fcade8534..73e55ffc135c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event. public partial class KeyVaultSecretNewVersionCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The id of the object that triggered this event. @@ -51,15 +22,8 @@ public partial class KeyVaultSecretNewVersionCreatedEventData /// The type of the object that triggered this event. /// The name of the object that triggered this event. /// The version of the object that triggered this event. - /// , , , or is null. internal KeyVaultSecretNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(vaultName, nameof(vaultName)); - Argument.AssertNotNull(objectType, nameof(objectType)); - Argument.AssertNotNull(objectName, nameof(objectName)); - Argument.AssertNotNull(version, nameof(version)); - Id = id; VaultName = vaultName; ObjectType = objectType; @@ -75,8 +39,8 @@ internal KeyVaultSecretNewVersionCreatedEventData(string id, string vaultName, s /// The version of the object that triggered this event. /// Not before date of the object that triggered this event. /// The expiration date of the object that triggered this event. - /// Keeps track of any properties unknown to the library. - internal KeyVaultSecretNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal KeyVaultSecretNewVersionCreatedEventData(string id, string vaultName, string objectType, string objectName, string version, float? nbf, float? exp, IDictionary additionalBinaryDataProperties) { Id = id; VaultName = vaultName; @@ -85,26 +49,27 @@ internal KeyVaultSecretNewVersionCreatedEventData(string id, string vaultName, s Version = version; Nbf = nbf; Exp = exp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal KeyVaultSecretNewVersionCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The id of the object that triggered this event. public string Id { get; } + /// Key vault name of the object that triggered this event. public string VaultName { get; } + /// The type of the object that triggered this event. public string ObjectType { get; } + /// The name of the object that triggered this event. public string ObjectName { get; } + /// The version of the object that triggered this event. public string Version { get; } + /// Not before date of the object that triggered this event. public float? Nbf { get; } + /// The expiration date of the object that triggered this event. public float? Exp { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs index bd665a7b0900..e294998192ad 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event. [JsonConverter(typeof(MachineLearningServicesDatasetDriftDetectedEventDataConverter))] - public partial class MachineLearningServicesDatasetDriftDetectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class MachineLearningServicesDatasetDriftDetectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MachineLearningServicesDatasetDriftDetectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8 /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesDatasetDriftDetectedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("dataDriftId"u8); writer.WriteStringValue(DataDriftId); writer.WritePropertyName("dataDriftName"u8); @@ -53,37 +57,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } if (Optional.IsDefined(StartTime)) { - if (StartTime != null) - { - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartTime.Value, "O"); - } - else - { - writer.WriteNull("startTime"); - } + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime.Value, "O"); } if (Optional.IsDefined(EndTime)) { - if (EndTime != null) - { - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndTime.Value, "O"); - } - else - { - writer.WriteNull("endTime"); - } + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -92,22 +82,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MachineLearningServicesDatasetDriftDetectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MachineLearningServicesDatasetDriftDetectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesDatasetDriftDetectedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesDatasetDriftDetectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMachineLearningServicesDatasetDriftDetectedEventData(document.RootElement, options); } - internal static MachineLearningServicesDatasetDriftDetectedEventData DeserializeMachineLearningServicesDatasetDriftDetectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MachineLearningServicesDatasetDriftDetectedEventData DeserializeMachineLearningServicesDatasetDriftDetectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -120,70 +115,68 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize double? driftCoefficient = default; DateTimeOffset? startTime = default; DateTimeOffset? endTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("dataDriftId"u8)) + if (prop.NameEquals("dataDriftId"u8)) { - dataDriftId = property.Value.GetString(); + dataDriftId = prop.Value.GetString(); continue; } - if (property.NameEquals("dataDriftName"u8)) + if (prop.NameEquals("dataDriftName"u8)) { - dataDriftName = property.Value.GetString(); + dataDriftName = prop.Value.GetString(); continue; } - if (property.NameEquals("runId"u8)) + if (prop.NameEquals("runId"u8)) { - runId = property.Value.GetString(); + runId = prop.Value.GetString(); continue; } - if (property.NameEquals("baseDatasetId"u8)) + if (prop.NameEquals("baseDatasetId"u8)) { - baseDatasetId = property.Value.GetString(); + baseDatasetId = prop.Value.GetString(); continue; } - if (property.NameEquals("targetDatasetId"u8)) + if (prop.NameEquals("targetDatasetId"u8)) { - targetDatasetId = property.Value.GetString(); + targetDatasetId = prop.Value.GetString(); continue; } - if (property.NameEquals("driftCoefficient"u8)) + if (prop.NameEquals("driftCoefficient"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - driftCoefficient = property.Value.GetDouble(); + driftCoefficient = prop.Value.GetDouble(); continue; } - if (property.NameEquals("startTime"u8)) + if (prop.NameEquals("startTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { startTime = null; continue; } - startTime = property.Value.GetDateTimeOffset("O"); + startTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("endTime"u8)) + if (prop.NameEquals("endTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { endTime = null; continue; } - endTime = property.Value.GetDateTimeOffset("O"); + endTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new MachineLearningServicesDatasetDriftDetectedEventData( dataDriftId, dataDriftName, @@ -193,13 +186,16 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize driftCoefficient, startTime, endTime, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -209,15 +205,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MachineLearningServicesDatasetDriftDetectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesDatasetDriftDetectedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMachineLearningServicesDatasetDriftDetectedEventData(document.RootElement, options); } default: @@ -225,35 +226,28 @@ MachineLearningServicesDatasetDriftDetectedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MachineLearningServicesDatasetDriftDetectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMachineLearningServicesDatasetDriftDetectedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MachineLearningServicesDatasetDriftDetectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MachineLearningServicesDatasetDriftDetectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MachineLearningServicesDatasetDriftDetectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningServicesDatasetDriftDetectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesDatasetDriftDetectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs index 66d7e5943085..354b1c4a924b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event. public partial class MachineLearningServicesDatasetDriftDetectedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The ID of the data drift monitor that triggered the event. @@ -51,15 +22,8 @@ public partial class MachineLearningServicesDatasetDriftDetectedEventData /// The ID of the Run that detected data drift. /// The ID of the base Dataset used to detect drift. /// The ID of the target Dataset used to detect drift. - /// , , , or is null. internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId) { - Argument.AssertNotNull(dataDriftId, nameof(dataDriftId)); - Argument.AssertNotNull(dataDriftName, nameof(dataDriftName)); - Argument.AssertNotNull(runId, nameof(runId)); - Argument.AssertNotNull(baseDatasetId, nameof(baseDatasetId)); - Argument.AssertNotNull(targetDatasetId, nameof(targetDatasetId)); - DataDriftId = dataDriftId; DataDriftName = dataDriftName; RunId = runId; @@ -76,8 +40,8 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId /// The coefficient result that triggered the event. /// The start time of the target dataset time series that resulted in drift detection. /// The end time of the target dataset time series that resulted in drift detection. - /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset? startTime, DateTimeOffset? endTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset? startTime, DateTimeOffset? endTime, IDictionary additionalBinaryDataProperties) { DataDriftId = dataDriftId; DataDriftName = dataDriftName; @@ -87,28 +51,30 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId DriftCoefficient = driftCoefficient; StartTime = startTime; EndTime = endTime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesDatasetDriftDetectedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ID of the data drift monitor that triggered the event. public string DataDriftId { get; } + /// The name of the data drift monitor that triggered the event. public string DataDriftName { get; } + /// The ID of the Run that detected data drift. public string RunId { get; } + /// The ID of the base Dataset used to detect drift. public string BaseDatasetId { get; } + /// The ID of the target Dataset used to detect drift. public string TargetDatasetId { get; } + /// The coefficient result that triggered the event. public double? DriftCoefficient { get; } + /// The start time of the target dataset time series that resulted in drift detection. public DateTimeOffset? StartTime { get; } + /// The end time of the target dataset time series that resulted in drift detection. public DateTimeOffset? EndTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.Serialization.cs index b07549fd4be7..2b6ceca34675 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event. [JsonConverter(typeof(MachineLearningServicesModelDeployedEventDataConverter))] - public partial class MachineLearningServicesModelDeployedEventData : IUtf8JsonSerializable, IJsonModel + public partial class MachineLearningServicesModelDeployedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MachineLearningServicesModelDeployedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesModelDeployedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("serviceName"u8); writer.WriteStringValue(ServiceName); writer.WritePropertyName("serviceComputeType"u8); @@ -52,15 +56,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("serviceProperties"u8); writer.WriteObjectValue(ServiceProperties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,22 +73,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MachineLearningServicesModelDeployedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MachineLearningServicesModelDeployedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesModelDeployedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesModelDeployedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMachineLearningServicesModelDeployedEventData(document.RootElement, options); } - internal static MachineLearningServicesModelDeployedEventData DeserializeMachineLearningServicesModelDeployedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MachineLearningServicesModelDeployedEventData DeserializeMachineLearningServicesModelDeployedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,62 +103,63 @@ internal static MachineLearningServicesModelDeployedEventData DeserializeMachine string modelIds = default; object serviceTags = default; object serviceProperties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("serviceName"u8)) + if (prop.NameEquals("serviceName"u8)) { - serviceName = property.Value.GetString(); + serviceName = prop.Value.GetString(); continue; } - if (property.NameEquals("serviceComputeType"u8)) + if (prop.NameEquals("serviceComputeType"u8)) { - serviceComputeType = property.Value.GetString(); + serviceComputeType = prop.Value.GetString(); continue; } - if (property.NameEquals("modelIds"u8)) + if (prop.NameEquals("modelIds"u8)) { - modelIds = property.Value.GetString(); + modelIds = prop.Value.GetString(); continue; } - if (property.NameEquals("serviceTags"u8)) + if (prop.NameEquals("serviceTags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - serviceTags = property.Value.GetObject(); + serviceTags = prop.Value.GetObject(); continue; } - if (property.NameEquals("serviceProperties"u8)) + if (prop.NameEquals("serviceProperties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - serviceProperties = property.Value.GetObject(); + serviceProperties = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new MachineLearningServicesModelDeployedEventData( serviceName, serviceComputeType, modelIds, serviceTags, serviceProperties, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -159,15 +169,20 @@ BinaryData IPersistableModel.Writ } } - MachineLearningServicesModelDeployedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MachineLearningServicesModelDeployedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesModelDeployedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMachineLearningServicesModelDeployedEventData(document.RootElement, options); } default: @@ -175,35 +190,28 @@ MachineLearningServicesModelDeployedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MachineLearningServicesModelDeployedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMachineLearningServicesModelDeployedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MachineLearningServicesModelDeployedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MachineLearningServicesModelDeployedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MachineLearningServicesModelDeployedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningServicesModelDeployedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesModelDeployedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.cs index 7782c16cf4fe..c4c92d2e07f0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelDeployedEventData.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event. public partial class MachineLearningServicesModelDeployedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The name of the deployed service. /// The compute type (e.g. ACI, AKS) of the deployed service. /// A common separated list of model IDs. The IDs of the models deployed in the service. - /// , or is null. internal MachineLearningServicesModelDeployedEventData(string serviceName, string serviceComputeType, string modelIds) { - Argument.AssertNotNull(serviceName, nameof(serviceName)); - Argument.AssertNotNull(serviceComputeType, nameof(serviceComputeType)); - Argument.AssertNotNull(modelIds, nameof(modelIds)); - ServiceName = serviceName; ServiceComputeType = serviceComputeType; ModelIds = modelIds; @@ -67,26 +33,23 @@ internal MachineLearningServicesModelDeployedEventData(string serviceName, strin /// A common separated list of model IDs. The IDs of the models deployed in the service. /// The tags of the deployed service. /// The properties of the deployed service. - /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesModelDeployedEventData(string serviceName, string serviceComputeType, string modelIds, object serviceTags, object serviceProperties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MachineLearningServicesModelDeployedEventData(string serviceName, string serviceComputeType, string modelIds, object serviceTags, object serviceProperties, IDictionary additionalBinaryDataProperties) { ServiceName = serviceName; ServiceComputeType = serviceComputeType; ModelIds = modelIds; ServiceTags = serviceTags; ServiceProperties = serviceProperties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesModelDeployedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the deployed service. public string ServiceName { get; } + /// The compute type (e.g. ACI, AKS) of the deployed service. public string ServiceComputeType { get; } + /// A common separated list of model IDs. The IDs of the models deployed in the service. public string ModelIds { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.Serialization.cs index 329fb81ad60d..89f32338fc2c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event. [JsonConverter(typeof(MachineLearningServicesModelRegisteredEventDataConverter))] - public partial class MachineLearningServicesModelRegisteredEventData : IUtf8JsonSerializable, IJsonModel + public partial class MachineLearningServicesModelRegisteredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MachineLearningServicesModelRegisteredEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesModelRegisteredEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("modelName"u8); writer.WriteStringValue(ModelName); writer.WritePropertyName("modelVersion"u8); @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelProperties"u8); writer.WriteObjectValue(ModelProperties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,22 +71,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MachineLearningServicesModelRegisteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MachineLearningServicesModelRegisteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesModelRegisteredEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesModelRegisteredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMachineLearningServicesModelRegisteredEventData(document.RootElement, options); } - internal static MachineLearningServicesModelRegisteredEventData DeserializeMachineLearningServicesModelRegisteredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MachineLearningServicesModelRegisteredEventData DeserializeMachineLearningServicesModelRegisteredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,51 +100,52 @@ internal static MachineLearningServicesModelRegisteredEventData DeserializeMachi string modelVersion = default; object modelTags = default; object modelProperties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("modelName"u8)) + if (prop.NameEquals("modelName"u8)) { - modelName = property.Value.GetString(); + modelName = prop.Value.GetString(); continue; } - if (property.NameEquals("modelVersion"u8)) + if (prop.NameEquals("modelVersion"u8)) { - modelVersion = property.Value.GetString(); + modelVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("modelTags"u8)) + if (prop.NameEquals("modelTags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - modelTags = property.Value.GetObject(); + modelTags = prop.Value.GetObject(); continue; } - if (property.NameEquals("modelProperties"u8)) + if (prop.NameEquals("modelProperties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - modelProperties = property.Value.GetObject(); + modelProperties = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MachineLearningServicesModelRegisteredEventData(modelName, modelVersion, modelTags, modelProperties, serializedAdditionalRawData); + return new MachineLearningServicesModelRegisteredEventData(modelName, modelVersion, modelTags, modelProperties, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -145,15 +155,20 @@ BinaryData IPersistableModel.Wr } } - MachineLearningServicesModelRegisteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MachineLearningServicesModelRegisteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesModelRegisteredEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMachineLearningServicesModelRegisteredEventData(document.RootElement, options); } default: @@ -161,35 +176,28 @@ MachineLearningServicesModelRegisteredEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MachineLearningServicesModelRegisteredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMachineLearningServicesModelRegisteredEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MachineLearningServicesModelRegisteredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MachineLearningServicesModelRegisteredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MachineLearningServicesModelRegisteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningServicesModelRegisteredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesModelRegisteredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.cs index a6faf238242a..dc9d2bdcb706 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesModelRegisteredEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event. public partial class MachineLearningServicesModelRegisteredEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The name of the model that was registered. /// The version of the model that was registered. - /// or is null. internal MachineLearningServicesModelRegisteredEventData(string modelName, string modelVersion) { - Argument.AssertNotNull(modelName, nameof(modelName)); - Argument.AssertNotNull(modelVersion, nameof(modelVersion)); - ModelName = modelName; ModelVersion = modelVersion; } @@ -63,23 +30,19 @@ internal MachineLearningServicesModelRegisteredEventData(string modelName, strin /// The version of the model that was registered. /// The tags of the model that was registered. /// The properties of the model that was registered. - /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesModelRegisteredEventData(string modelName, string modelVersion, object modelTags, object modelProperties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MachineLearningServicesModelRegisteredEventData(string modelName, string modelVersion, object modelTags, object modelProperties, IDictionary additionalBinaryDataProperties) { ModelName = modelName; ModelVersion = modelVersion; ModelTags = modelTags; ModelProperties = modelProperties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesModelRegisteredEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the model that was registered. public string ModelName { get; } + /// The version of the model that was registered. public string ModelVersion { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.Serialization.cs index e6dfd40823a9..aba9e0deb0ea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event. [JsonConverter(typeof(MachineLearningServicesRunCompletedEventDataConverter))] - public partial class MachineLearningServicesRunCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class MachineLearningServicesRunCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MachineLearningServicesRunCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesRunCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("experimentId"u8); writer.WriteStringValue(ExperimentId); writer.WritePropertyName("experimentName"u8); @@ -54,15 +58,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("runProperties"u8); writer.WriteObjectValue(RunProperties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -71,22 +75,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MachineLearningServicesRunCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MachineLearningServicesRunCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesRunCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesRunCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMachineLearningServicesRunCompletedEventData(document.RootElement, options); } - internal static MachineLearningServicesRunCompletedEventData DeserializeMachineLearningServicesRunCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MachineLearningServicesRunCompletedEventData DeserializeMachineLearningServicesRunCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -97,54 +106,52 @@ internal static MachineLearningServicesRunCompletedEventData DeserializeMachineL string runType = default; object runTags = default; object runProperties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("experimentId"u8)) + if (prop.NameEquals("experimentId"u8)) { - experimentId = property.Value.GetString(); + experimentId = prop.Value.GetString(); continue; } - if (property.NameEquals("experimentName"u8)) + if (prop.NameEquals("experimentName"u8)) { - experimentName = property.Value.GetString(); + experimentName = prop.Value.GetString(); continue; } - if (property.NameEquals("runId"u8)) + if (prop.NameEquals("runId"u8)) { - runId = property.Value.GetString(); + runId = prop.Value.GetString(); continue; } - if (property.NameEquals("runType"u8)) + if (prop.NameEquals("runType"u8)) { - runType = property.Value.GetString(); + runType = prop.Value.GetString(); continue; } - if (property.NameEquals("runTags"u8)) + if (prop.NameEquals("runTags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - runTags = property.Value.GetObject(); + runTags = prop.Value.GetObject(); continue; } - if (property.NameEquals("runProperties"u8)) + if (prop.NameEquals("runProperties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - runProperties = property.Value.GetObject(); + runProperties = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new MachineLearningServicesRunCompletedEventData( experimentId, experimentName, @@ -152,13 +159,16 @@ internal static MachineLearningServicesRunCompletedEventData DeserializeMachineL runType, runTags, runProperties, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -168,15 +178,20 @@ BinaryData IPersistableModel.Write } } - MachineLearningServicesRunCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MachineLearningServicesRunCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesRunCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMachineLearningServicesRunCompletedEventData(document.RootElement, options); } default: @@ -184,35 +199,28 @@ MachineLearningServicesRunCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MachineLearningServicesRunCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMachineLearningServicesRunCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MachineLearningServicesRunCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MachineLearningServicesRunCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MachineLearningServicesRunCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningServicesRunCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesRunCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.cs index bd0342f7f41d..b5dbe63f01d9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunCompletedEventData.cs @@ -13,51 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event. public partial class MachineLearningServicesRunCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The ID of the experiment that the run belongs to. /// The name of the experiment that the run belongs to. /// The ID of the Run that was completed. /// The Run Type of the completed Run. - /// , , or is null. internal MachineLearningServicesRunCompletedEventData(string experimentId, string experimentName, string runId, string runType) { - Argument.AssertNotNull(experimentId, nameof(experimentId)); - Argument.AssertNotNull(experimentName, nameof(experimentName)); - Argument.AssertNotNull(runId, nameof(runId)); - Argument.AssertNotNull(runType, nameof(runType)); - ExperimentId = experimentId; ExperimentName = experimentName; RunId = runId; @@ -71,8 +36,8 @@ internal MachineLearningServicesRunCompletedEventData(string experimentId, strin /// The Run Type of the completed Run. /// The tags of the completed Run. /// The properties of the completed Run. - /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesRunCompletedEventData(string experimentId, string experimentName, string runId, string runType, object runTags, object runProperties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MachineLearningServicesRunCompletedEventData(string experimentId, string experimentName, string runId, string runType, object runTags, object runProperties, IDictionary additionalBinaryDataProperties) { ExperimentId = experimentId; ExperimentName = experimentName; @@ -80,20 +45,18 @@ internal MachineLearningServicesRunCompletedEventData(string experimentId, strin RunType = runType; RunTags = runTags; RunProperties = runProperties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesRunCompletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ID of the experiment that the run belongs to. public string ExperimentId { get; } + /// The name of the experiment that the run belongs to. public string ExperimentName { get; } + /// The ID of the Run that was completed. public string RunId { get; } + /// The Run Type of the completed Run. public string RunType { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.Serialization.cs index 95ebc0e04428..b0112d911037 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event. [JsonConverter(typeof(MachineLearningServicesRunStatusChangedEventDataConverter))] - public partial class MachineLearningServicesRunStatusChangedEventData : IUtf8JsonSerializable, IJsonModel + public partial class MachineLearningServicesRunStatusChangedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MachineLearningServicesRunStatusChangedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8Json /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesRunStatusChangedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("experimentId"u8); writer.WriteStringValue(ExperimentId); writer.WritePropertyName("experimentName"u8); @@ -56,15 +60,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("runStatus"u8); writer.WriteStringValue(RunStatus); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,22 +77,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MachineLearningServicesRunStatusChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MachineLearningServicesRunStatusChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesRunStatusChangedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MachineLearningServicesRunStatusChangedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMachineLearningServicesRunStatusChangedEventData(document.RootElement, options); } - internal static MachineLearningServicesRunStatusChangedEventData DeserializeMachineLearningServicesRunStatusChangedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MachineLearningServicesRunStatusChangedEventData DeserializeMachineLearningServicesRunStatusChangedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -100,59 +109,57 @@ internal static MachineLearningServicesRunStatusChangedEventData DeserializeMach object runTags = default; object runProperties = default; string runStatus = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("experimentId"u8)) + if (prop.NameEquals("experimentId"u8)) { - experimentId = property.Value.GetString(); + experimentId = prop.Value.GetString(); continue; } - if (property.NameEquals("experimentName"u8)) + if (prop.NameEquals("experimentName"u8)) { - experimentName = property.Value.GetString(); + experimentName = prop.Value.GetString(); continue; } - if (property.NameEquals("runId"u8)) + if (prop.NameEquals("runId"u8)) { - runId = property.Value.GetString(); + runId = prop.Value.GetString(); continue; } - if (property.NameEquals("runType"u8)) + if (prop.NameEquals("runType"u8)) { - runType = property.Value.GetString(); + runType = prop.Value.GetString(); continue; } - if (property.NameEquals("runTags"u8)) + if (prop.NameEquals("runTags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - runTags = property.Value.GetObject(); + runTags = prop.Value.GetObject(); continue; } - if (property.NameEquals("runProperties"u8)) + if (prop.NameEquals("runProperties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - runProperties = property.Value.GetObject(); + runProperties = prop.Value.GetObject(); continue; } - if (property.NameEquals("runStatus"u8)) + if (prop.NameEquals("runStatus"u8)) { - runStatus = property.Value.GetString(); + runStatus = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new MachineLearningServicesRunStatusChangedEventData( experimentId, experimentName, @@ -161,13 +168,16 @@ internal static MachineLearningServicesRunStatusChangedEventData DeserializeMach runTags, runProperties, runStatus, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -177,15 +187,20 @@ BinaryData IPersistableModel.W } } - MachineLearningServicesRunStatusChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MachineLearningServicesRunStatusChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MachineLearningServicesRunStatusChangedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMachineLearningServicesRunStatusChangedEventData(document.RootElement, options); } default: @@ -193,35 +208,28 @@ MachineLearningServicesRunStatusChangedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MachineLearningServicesRunStatusChangedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMachineLearningServicesRunStatusChangedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MachineLearningServicesRunStatusChangedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MachineLearningServicesRunStatusChangedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MachineLearningServicesRunStatusChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineLearningServicesRunStatusChangedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesRunStatusChangedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.cs index ea1a6de96301..1a9cd2264bce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesRunStatusChangedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event. public partial class MachineLearningServicesRunStatusChangedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The ID of the experiment that the Machine Learning Run belongs to. @@ -51,15 +22,8 @@ public partial class MachineLearningServicesRunStatusChangedEventData /// The ID of the Machine Learning Run. /// The Run Type of the Machine Learning Run. /// The status of the Machine Learning Run. - /// , , , or is null. internal MachineLearningServicesRunStatusChangedEventData(string experimentId, string experimentName, string runId, string runType, string runStatus) { - Argument.AssertNotNull(experimentId, nameof(experimentId)); - Argument.AssertNotNull(experimentName, nameof(experimentName)); - Argument.AssertNotNull(runId, nameof(runId)); - Argument.AssertNotNull(runType, nameof(runType)); - Argument.AssertNotNull(runStatus, nameof(runStatus)); - ExperimentId = experimentId; ExperimentName = experimentName; RunId = runId; @@ -75,8 +39,8 @@ internal MachineLearningServicesRunStatusChangedEventData(string experimentId, s /// The tags of the Machine Learning Run. /// The properties of the Machine Learning Run. /// The status of the Machine Learning Run. - /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesRunStatusChangedEventData(string experimentId, string experimentName, string runId, string runType, object runTags, object runProperties, string runStatus, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MachineLearningServicesRunStatusChangedEventData(string experimentId, string experimentName, string runId, string runType, object runTags, object runProperties, string runStatus, IDictionary additionalBinaryDataProperties) { ExperimentId = experimentId; ExperimentName = experimentName; @@ -85,22 +49,21 @@ internal MachineLearningServicesRunStatusChangedEventData(string experimentId, s RunTags = runTags; RunProperties = runProperties; RunStatus = runStatus; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesRunStatusChangedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The ID of the experiment that the Machine Learning Run belongs to. public string ExperimentId { get; } + /// The name of the experiment that the Machine Learning Run belongs to. public string ExperimentName { get; } + /// The ID of the Machine Learning Run. public string RunId { get; } + /// The Run Type of the Machine Learning Run. public string RunType { get; } + /// The status of the Machine Learning Run. public string RunStatus { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.Serialization.cs index 54ae4a7f802a..194703cfb9a6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event. [JsonConverter(typeof(MapsGeofenceEnteredEventDataConverter))] - public partial class MapsGeofenceEnteredEventData : IUtf8JsonSerializable, IJsonModel + public partial class MapsGeofenceEnteredEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +30,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceEnteredEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - MapsGeofenceEnteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MapsGeofenceEnteredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (MapsGeofenceEnteredEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override MapsGeofenceEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceEnteredEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMapsGeofenceEnteredEventData(document.RootElement, options); } - internal static MapsGeofenceEnteredEventData DeserializeMapsGeofenceEnteredEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MapsGeofenceEnteredEventData DeserializeMapsGeofenceEnteredEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,62 +67,77 @@ internal static MapsGeofenceEnteredEventData DeserializeMapsGeofenceEnteredEvent IReadOnlyList geometries = default; IReadOnlyList invalidPeriodGeofenceGeometryId = default; bool? isEventPublished = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredGeofenceGeometryId"u8)) + if (prop.NameEquals("expiredGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } expiredGeofenceGeometryId = array; continue; } - if (property.NameEquals("geometries"u8)) + if (prop.NameEquals("geometries"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(MapsGeofenceGeometry.DeserializeMapsGeofenceGeometry(item, options)); } geometries = array; continue; } - if (property.NameEquals("invalidPeriodGeofenceGeometryId"u8)) + if (prop.NameEquals("invalidPeriodGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } invalidPeriodGeofenceGeometryId = array; continue; } - if (property.NameEquals("isEventPublished"u8)) + if (prop.NameEquals("isEventPublished"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isEventPublished = property.Value.GetBoolean(); + isEventPublished = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MapsGeofenceEnteredEventData(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData); + return new MapsGeofenceEnteredEventData(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -128,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - MapsGeofenceEnteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MapsGeofenceEnteredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (MapsGeofenceEnteredEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override MapsGeofenceEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMapsGeofenceEnteredEventData(document.RootElement, options); } default: @@ -144,35 +168,28 @@ MapsGeofenceEnteredEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MapsGeofenceEnteredEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMapsGeofenceEnteredEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MapsGeofenceEnteredEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MapsGeofenceEnteredEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MapsGeofenceEnteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMapsGeofenceEnteredEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceEnteredEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.cs index 917a81f6db1a..398d0d245d3d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEnteredEventData.cs @@ -23,8 +23,8 @@ internal MapsGeofenceEnteredEventData() /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. - /// Keeps track of any properties unknown to the library. - internal MapsGeofenceEnteredEventData(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary serializedAdditionalRawData) : base(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MapsGeofenceEnteredEventData(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary additionalBinaryDataProperties) : base(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.Serialization.cs index 0f026d11d234..783f91301e6c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class MapsGeofenceEventProperties : IUtf8JsonSerializable, IJsonModel + /// Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult). + public partial class MapsGeofenceEventProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,18 +28,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceEventProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") { writer.WritePropertyName("expiredGeofenceGeometryId"u8); writer.WriteStartArray(); - foreach (var item in ExpiredGeofenceGeometryId) + foreach (string item in ExpiredGeofenceGeometryId) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -48,7 +52,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("geometries"u8); writer.WriteStartArray(); - foreach (var item in Geometries) + foreach (MapsGeofenceGeometry item in Geometries) { writer.WriteObjectValue(item, options); } @@ -58,8 +62,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("invalidPeriodGeofenceGeometryId"u8); writer.WriteStartArray(); - foreach (var item in InvalidPeriodGeofenceGeometryId) + foreach (string item in InvalidPeriodGeofenceGeometryId) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -69,15 +78,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("isEventPublished"u8); writer.WriteBooleanValue(IsEventPublished.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +95,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MapsGeofenceEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MapsGeofenceEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MapsGeofenceEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceEventProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMapsGeofenceEventProperties(document.RootElement, options); } - internal static MapsGeofenceEventProperties DeserializeMapsGeofenceEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MapsGeofenceEventProperties DeserializeMapsGeofenceEventProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -110,62 +124,77 @@ internal static MapsGeofenceEventProperties DeserializeMapsGeofenceEventProperti IReadOnlyList geometries = default; IReadOnlyList invalidPeriodGeofenceGeometryId = default; bool? isEventPublished = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredGeofenceGeometryId"u8)) + if (prop.NameEquals("expiredGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } expiredGeofenceGeometryId = array; continue; } - if (property.NameEquals("geometries"u8)) + if (prop.NameEquals("geometries"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(MapsGeofenceGeometry.DeserializeMapsGeofenceGeometry(item, options)); } geometries = array; continue; } - if (property.NameEquals("invalidPeriodGeofenceGeometryId"u8)) + if (prop.NameEquals("invalidPeriodGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } invalidPeriodGeofenceGeometryId = array; continue; } - if (property.NameEquals("isEventPublished"u8)) + if (prop.NameEquals("isEventPublished"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isEventPublished = property.Value.GetBoolean(); + isEventPublished = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MapsGeofenceEventProperties(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData); + return new MapsGeofenceEventProperties(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -175,15 +204,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - MapsGeofenceEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MapsGeofenceEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MapsGeofenceEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMapsGeofenceEventProperties(document.RootElement, options); } default: @@ -191,22 +225,7 @@ MapsGeofenceEventProperties IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MapsGeofenceEventProperties FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMapsGeofenceEventProperties(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.cs index 6535b899695a..378998c12b34 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceEventProperties.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult). public partial class MapsGeofenceEventProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal MapsGeofenceEventProperties() @@ -58,22 +29,25 @@ internal MapsGeofenceEventProperties() /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. - /// Keeps track of any properties unknown to the library. - internal MapsGeofenceEventProperties(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MapsGeofenceEventProperties(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary additionalBinaryDataProperties) { ExpiredGeofenceGeometryId = expiredGeofenceGeometryId; Geometries = geometries; InvalidPeriodGeofenceGeometryId = invalidPeriodGeofenceGeometryId; IsEventPublished = isEventPublished; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Lists of the geometry ID of the geofence which is expired relative to the user time in the request. public IReadOnlyList ExpiredGeofenceGeometryId { get; } + /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. public IReadOnlyList Geometries { get; } + /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. public IReadOnlyList InvalidPeriodGeofenceGeometryId { get; } + /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. public bool? IsEventPublished { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.Serialization.cs index 8e330d77698a..630767ad51dd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceExited event. [JsonConverter(typeof(MapsGeofenceExitedEventDataConverter))] - public partial class MapsGeofenceExitedEventData : IUtf8JsonSerializable, IJsonModel + public partial class MapsGeofenceExitedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +30,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceExitedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - MapsGeofenceExitedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MapsGeofenceExitedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (MapsGeofenceExitedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override MapsGeofenceEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceExitedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMapsGeofenceExitedEventData(document.RootElement, options); } - internal static MapsGeofenceExitedEventData DeserializeMapsGeofenceExitedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MapsGeofenceExitedEventData DeserializeMapsGeofenceExitedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,62 +67,77 @@ internal static MapsGeofenceExitedEventData DeserializeMapsGeofenceExitedEventDa IReadOnlyList geometries = default; IReadOnlyList invalidPeriodGeofenceGeometryId = default; bool? isEventPublished = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredGeofenceGeometryId"u8)) + if (prop.NameEquals("expiredGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } expiredGeofenceGeometryId = array; continue; } - if (property.NameEquals("geometries"u8)) + if (prop.NameEquals("geometries"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(MapsGeofenceGeometry.DeserializeMapsGeofenceGeometry(item, options)); } geometries = array; continue; } - if (property.NameEquals("invalidPeriodGeofenceGeometryId"u8)) + if (prop.NameEquals("invalidPeriodGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } invalidPeriodGeofenceGeometryId = array; continue; } - if (property.NameEquals("isEventPublished"u8)) + if (prop.NameEquals("isEventPublished"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isEventPublished = property.Value.GetBoolean(); + isEventPublished = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MapsGeofenceExitedEventData(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData); + return new MapsGeofenceExitedEventData(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -128,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - MapsGeofenceExitedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MapsGeofenceExitedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (MapsGeofenceExitedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override MapsGeofenceEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMapsGeofenceExitedEventData(document.RootElement, options); } default: @@ -144,35 +168,28 @@ MapsGeofenceExitedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MapsGeofenceExitedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMapsGeofenceExitedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MapsGeofenceExitedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MapsGeofenceExitedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MapsGeofenceExitedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMapsGeofenceExitedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceExitedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.cs index ea1b7a3f4635..7d9e711de75d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceExitedEventData.cs @@ -23,8 +23,8 @@ internal MapsGeofenceExitedEventData() /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. - /// Keeps track of any properties unknown to the library. - internal MapsGeofenceExitedEventData(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary serializedAdditionalRawData) : base(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MapsGeofenceExitedEventData(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary additionalBinaryDataProperties) : base(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.Serialization.cs index 54b55b300945..f1c9222a4c84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class MapsGeofenceGeometry : IUtf8JsonSerializable, IJsonModel + /// The geofence geometry. + public partial class MapsGeofenceGeometry : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MapsGeofenceGeometry() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceGeometry)} does not support writing '{format}' format."); } - writer.WritePropertyName("deviceId"u8); writer.WriteStringValue(DeviceId); if (Optional.IsDefined(Distance)) @@ -58,15 +62,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("udId"u8); writer.WriteStringValue(UdId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,22 +79,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MapsGeofenceGeometry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MapsGeofenceGeometry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MapsGeofenceGeometry JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceGeometry)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMapsGeofenceGeometry(document.RootElement, options); } - internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -101,58 +110,56 @@ internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement float? nearestLat = default; float? nearestLon = default; string udId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deviceId"u8)) + if (prop.NameEquals("deviceId"u8)) { - deviceId = property.Value.GetString(); + deviceId = prop.Value.GetString(); continue; } - if (property.NameEquals("distance"u8)) + if (prop.NameEquals("distance"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - distance = property.Value.GetSingle(); + distance = prop.Value.GetSingle(); continue; } - if (property.NameEquals("geometryId"u8)) + if (prop.NameEquals("geometryId"u8)) { - geometryId = property.Value.GetString(); + geometryId = prop.Value.GetString(); continue; } - if (property.NameEquals("nearestLat"u8)) + if (prop.NameEquals("nearestLat"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nearestLat = property.Value.GetSingle(); + nearestLat = prop.Value.GetSingle(); continue; } - if (property.NameEquals("nearestLon"u8)) + if (prop.NameEquals("nearestLon"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nearestLon = property.Value.GetSingle(); + nearestLon = prop.Value.GetSingle(); continue; } - if (property.NameEquals("udId"u8)) + if (prop.NameEquals("udId"u8)) { - udId = property.Value.GetString(); + udId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new MapsGeofenceGeometry( deviceId, distance, @@ -160,13 +167,16 @@ internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement nearestLat, nearestLon, udId, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -176,15 +186,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - MapsGeofenceGeometry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MapsGeofenceGeometry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MapsGeofenceGeometry PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMapsGeofenceGeometry(document.RootElement, options); } default: @@ -192,22 +207,7 @@ MapsGeofenceGeometry IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MapsGeofenceGeometry FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMapsGeofenceGeometry(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.cs index 5e7f74e9aa5d..7ca0be73c1df 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceGeometry.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The geofence geometry. public partial class MapsGeofenceGeometry { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// ID of the device. /// The unique ID for the geofence geometry. - /// or is null. internal MapsGeofenceGeometry(string deviceId, string geometryId) { - Argument.AssertNotNull(deviceId, nameof(deviceId)); - Argument.AssertNotNull(geometryId, nameof(geometryId)); - DeviceId = deviceId; GeometryId = geometryId; } @@ -65,8 +32,8 @@ internal MapsGeofenceGeometry(string deviceId, string geometryId) /// Latitude of the nearest point of the geometry. /// Longitude of the nearest point of the geometry. /// The unique id returned from user upload service when uploading a geofence. Will not be included in geofencing post API. - /// Keeps track of any properties unknown to the library. - internal MapsGeofenceGeometry(string deviceId, float? distance, string geometryId, float? nearestLat, float? nearestLon, string udId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MapsGeofenceGeometry(string deviceId, float? distance, string geometryId, float? nearestLat, float? nearestLon, string udId, IDictionary additionalBinaryDataProperties) { DeviceId = deviceId; Distance = distance; @@ -74,24 +41,24 @@ internal MapsGeofenceGeometry(string deviceId, float? distance, string geometryI NearestLat = nearestLat; NearestLon = nearestLon; UdId = udId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MapsGeofenceGeometry() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// ID of the device. public string DeviceId { get; } + /// Distance from the coordinate to the closest border of the geofence. Positive means the coordinate is outside of the geofence. If the coordinate is outside of the geofence, but more than the value of searchBuffer away from the closest geofence border, then the value is 999. Negative means the coordinate is inside of the geofence. If the coordinate is inside the polygon, but more than the value of searchBuffer away from the closest geofencing border,then the value is -999. A value of 999 means that there is great confidence the coordinate is well outside the geofence. A value of -999 means that there is great confidence the coordinate is well within the geofence. public float? Distance { get; } + /// The unique ID for the geofence geometry. public string GeometryId { get; } + /// Latitude of the nearest point of the geometry. public float? NearestLat { get; } + /// Longitude of the nearest point of the geometry. public float? NearestLon { get; } + /// The unique id returned from user upload service when uploading a geofence. Will not be included in geofencing post API. public string UdId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.Serialization.cs index 2beda5611f22..b6ee168d065b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceResult event. [JsonConverter(typeof(MapsGeofenceResultEventDataConverter))] - public partial class MapsGeofenceResultEventData : IUtf8JsonSerializable, IJsonModel + public partial class MapsGeofenceResultEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,31 +30,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceResultEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - MapsGeofenceResultEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MapsGeofenceResultEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (MapsGeofenceResultEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override MapsGeofenceEventProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MapsGeofenceResultEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMapsGeofenceResultEventData(document.RootElement, options); } - internal static MapsGeofenceResultEventData DeserializeMapsGeofenceResultEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MapsGeofenceResultEventData DeserializeMapsGeofenceResultEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -63,62 +67,77 @@ internal static MapsGeofenceResultEventData DeserializeMapsGeofenceResultEventDa IReadOnlyList geometries = default; IReadOnlyList invalidPeriodGeofenceGeometryId = default; bool? isEventPublished = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("expiredGeofenceGeometryId"u8)) + if (prop.NameEquals("expiredGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } expiredGeofenceGeometryId = array; continue; } - if (property.NameEquals("geometries"u8)) + if (prop.NameEquals("geometries"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(MapsGeofenceGeometry.DeserializeMapsGeofenceGeometry(item, options)); } geometries = array; continue; } - if (property.NameEquals("invalidPeriodGeofenceGeometryId"u8)) + if (prop.NameEquals("invalidPeriodGeofenceGeometryId"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } invalidPeriodGeofenceGeometryId = array; continue; } - if (property.NameEquals("isEventPublished"u8)) + if (prop.NameEquals("isEventPublished"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isEventPublished = property.Value.GetBoolean(); + isEventPublished = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MapsGeofenceResultEventData(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData); + return new MapsGeofenceResultEventData(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -128,15 +147,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - MapsGeofenceResultEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MapsGeofenceResultEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (MapsGeofenceResultEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override MapsGeofenceEventProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMapsGeofenceResultEventData(document.RootElement, options); } default: @@ -144,35 +168,28 @@ MapsGeofenceResultEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MapsGeofenceResultEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMapsGeofenceResultEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class MapsGeofenceResultEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, MapsGeofenceResultEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override MapsGeofenceResultEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeMapsGeofenceResultEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceResultEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.cs index b8a9abb6001c..04555ef25dfe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MapsGeofenceResultEventData.cs @@ -23,8 +23,8 @@ internal MapsGeofenceResultEventData() /// Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence. /// Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request. /// True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. - /// Keeps track of any properties unknown to the library. - internal MapsGeofenceResultEventData(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary serializedAdditionalRawData) : base(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MapsGeofenceResultEventData(IReadOnlyList expiredGeofenceGeometryId, IReadOnlyList geometries, IReadOnlyList invalidPeriodGeofenceGeometryId, bool? isEventPublished, IDictionary additionalBinaryDataProperties) : base(expiredGeofenceGeometryId, geometries, invalidPeriodGeofenceGeometryId, isEventPublished, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MessagingEventGridSystemEventsClientBuilderExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MessagingEventGridSystemEventsClientBuilderExtensions.cs deleted file mode 100644 index fa52576d716c..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MessagingEventGridSystemEventsClientBuilderExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Extensions.Azure -{ - /// Extension methods to add to client builder. - internal static partial class MessagingEventGridSystemEventsClientBuilderExtensions - { - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs index 28764b61f602..a94b874c7a68 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class MicrosoftTeamsUserIdentifierModel : IUtf8JsonSerializable, IJsonModel + /// A Microsoft Teams user. + public partial class MicrosoftTeamsUserIdentifierModel : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal MicrosoftTeamsUserIdentifierModel() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MicrosoftTeamsUserIdentifierModel)} does not support writing '{format}' format."); } - writer.WritePropertyName("userId"u8); writer.WriteStringValue(UserId); if (Optional.IsDefined(IsAnonymous)) @@ -46,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cloud"u8); writer.WriteStringValue(Cloud.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MicrosoftTeamsUserIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + MicrosoftTeamsUserIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual MicrosoftTeamsUserIdentifierModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MicrosoftTeamsUserIdentifierModel)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMicrosoftTeamsUserIdentifierModel(document.RootElement, options); } - internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserIdentifierModel(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserIdentifierModel(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -86,46 +95,47 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI string userId = default; bool? isAnonymous = default; CommunicationCloudEnvironmentModel? cloud = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("userId"u8)) + if (prop.NameEquals("userId"u8)) { - userId = property.Value.GetString(); + userId = prop.Value.GetString(); continue; } - if (property.NameEquals("isAnonymous"u8)) + if (prop.NameEquals("isAnonymous"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - isAnonymous = property.Value.GetBoolean(); + isAnonymous = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("cloud"u8)) + if (prop.NameEquals("cloud"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); + cloud = new CommunicationCloudEnvironmentModel(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, serializedAdditionalRawData); + return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -135,15 +145,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - MicrosoftTeamsUserIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + MicrosoftTeamsUserIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual MicrosoftTeamsUserIdentifierModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeMicrosoftTeamsUserIdentifierModel(document.RootElement, options); } default: @@ -151,22 +166,7 @@ MicrosoftTeamsUserIdentifierModel IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MicrosoftTeamsUserIdentifierModel FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMicrosoftTeamsUserIdentifierModel(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs index 1678ab0098cf..8512ba313dd6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// A Microsoft Teams user. public partial class MicrosoftTeamsUserIdentifierModel { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. - /// is null. internal MicrosoftTeamsUserIdentifierModel(string userId) { - Argument.AssertNotNull(userId, nameof(userId)); - UserId = userId; } @@ -59,24 +27,21 @@ internal MicrosoftTeamsUserIdentifierModel(string userId) /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. /// True if the Microsoft Teams user is anonymous. By default false if missing. /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. - /// Keeps track of any properties unknown to the library. - internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel? cloud, IDictionary additionalBinaryDataProperties) { UserId = userId; IsAnonymous = isAnonymous; Cloud = cloud; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MicrosoftTeamsUserIdentifierModel() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. public string UserId { get; } + /// True if the Microsoft Teams user is anonymous. By default false if missing. public bool? IsAnonymous { get; } + /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. public CommunicationCloudEnvironmentModel? Cloud { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs index e4ee2f3618ce..f0b42ecedda0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs @@ -11,74 +11,130 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// /// Context class which will be filled in by the System.ClientModel.SourceGeneration. - /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// For more information /// - [ModelReaderWriterBuildable(typeof(AcsCallEndedByProperties))] - [ModelReaderWriterBuildable(typeof(AcsCallEndedEventData))] - [ModelReaderWriterBuildable(typeof(AcsCallEndReasonProperties))] - [ModelReaderWriterBuildable(typeof(AcsCallGroupProperties))] + [ModelReaderWriterBuildable(typeof(ApiCenterApiDefinitionAddedEventData))] + [ModelReaderWriterBuildable(typeof(ApiCenterApiSpecification))] + [ModelReaderWriterBuildable(typeof(ApiCenterApiDefinitionUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementUserCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementUserUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementUserDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementSubscriptionCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementSubscriptionUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementSubscriptionDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementProductCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementProductUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementProductDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementApiCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementApiUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementApiDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementApiReleaseCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementApiReleaseUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementApiReleaseDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayHostnameConfigurationCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayHostnameConfigurationUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayHostnameConfigurationDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCertificateAuthorityCreatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCertificateAuthorityUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCertificateAuthorityDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayApiAddedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayApiRemovedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementCircuitBreakerOpenedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementCircuitBreakerProperties))] + [ModelReaderWriterBuildable(typeof(ApiManagementCircuitBreakerClosedEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayTokenNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayProperties))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayTokenNearExpiryProperties))] + [ModelReaderWriterBuildable(typeof(ApiManagementGatewayTokenExpiredEventData))] + [ModelReaderWriterBuildable(typeof(ApiManagementExpiredGatewayTokenProperties))] + [ModelReaderWriterBuildable(typeof(AppConfigurationKeyValueModifiedEventData))] + [ModelReaderWriterBuildable(typeof(AppConfigurationKeyValueDeletedEventData))] + [ModelReaderWriterBuildable(typeof(AppConfigurationSnapshotEventData))] + [ModelReaderWriterBuildable(typeof(AppConfigurationSnapshotCreatedEventData))] + [ModelReaderWriterBuildable(typeof(AppConfigurationSnapshotModifiedEventData))] + [ModelReaderWriterBuildable(typeof(AvsPrivateCloudEventData))] + [ModelReaderWriterBuildable(typeof(AvsPrivateCloudUpdatingEventData))] + [ModelReaderWriterBuildable(typeof(AvsPrivateCloudUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(AvsPrivateCloudFailedEventData))] + [ModelReaderWriterBuildable(typeof(AvsClusterEventData))] + [ModelReaderWriterBuildable(typeof(AvsClusterCreatedEventData))] + [ModelReaderWriterBuildable(typeof(AvsClusterDeletedEventData))] + [ModelReaderWriterBuildable(typeof(AvsClusterUpdatingEventData))] + [ModelReaderWriterBuildable(typeof(AvsClusterUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(AvsClusterFailedEventData))] + [ModelReaderWriterBuildable(typeof(AvsScriptExecutionEventData))] + [ModelReaderWriterBuildable(typeof(AvsScriptExecutionStartedEventData))] + [ModelReaderWriterBuildable(typeof(AvsScriptExecutionFinishedEventData))] + [ModelReaderWriterBuildable(typeof(AvsScriptExecutionCancelledEventData))] + [ModelReaderWriterBuildable(typeof(AvsScriptExecutionFailedEventData))] + [ModelReaderWriterBuildable(typeof(AcsIncomingCallEventData))] + [ModelReaderWriterBuildable(typeof(CommunicationIdentifierModel))] + [ModelReaderWriterBuildable(typeof(CommunicationUserIdentifierModel))] + [ModelReaderWriterBuildable(typeof(PhoneNumberIdentifierModel))] + [ModelReaderWriterBuildable(typeof(MicrosoftTeamsUserIdentifierModel))] + [ModelReaderWriterBuildable(typeof(AcsMicrosoftTeamsAppIdentifier))] + [ModelReaderWriterBuildable(typeof(AcsIncomingCallCustomContext))] + [ModelReaderWriterBuildable(typeof(AcsUserDisconnectedEventData))] [ModelReaderWriterBuildable(typeof(AcsCallingEventProperties))] - [ModelReaderWriterBuildable(typeof(AcsCallParticipantAddedEventData))] - [ModelReaderWriterBuildable(typeof(AcsCallParticipantEventData))] [ModelReaderWriterBuildable(typeof(AcsCallParticipantProperties))] - [ModelReaderWriterBuildable(typeof(AcsCallParticipantRemovedEventData))] + [ModelReaderWriterBuildable(typeof(AcsCallGroupProperties))] [ModelReaderWriterBuildable(typeof(AcsCallRoomProperties))] [ModelReaderWriterBuildable(typeof(AcsCallStartedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatAzureBotCommandReceivedInThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsCallEndedEventData))] + [ModelReaderWriterBuildable(typeof(AcsCallEndedByProperties))] + [ModelReaderWriterBuildable(typeof(AcsCallEndReasonProperties))] + [ModelReaderWriterBuildable(typeof(AcsCallParticipantEventData))] + [ModelReaderWriterBuildable(typeof(AcsCallParticipantAddedEventData))] + [ModelReaderWriterBuildable(typeof(AcsCallParticipantRemovedEventData))] [ModelReaderWriterBuildable(typeof(AcsChatEventBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatEventInThreadBaseProperties))] - [ModelReaderWriterBuildable(typeof(AcsChatMessageDeletedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatMessageDeletedInThreadEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatMessageEditedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatMessageEditedInThreadEventData))] [ModelReaderWriterBuildable(typeof(AcsChatMessageEventBaseProperties))] - [ModelReaderWriterBuildable(typeof(AcsChatMessageEventInThreadBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatMessageReceivedEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatMessageEventInThreadBaseProperties))] + [ModelReaderWriterBuildable(typeof(AcsChatAzureBotCommandReceivedInThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatTypingIndicatorReceivedInThreadEventData))] [ModelReaderWriterBuildable(typeof(AcsChatMessageReceivedInThreadEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatParticipantAddedToThreadEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatParticipantAddedToThreadWithUserEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatParticipantRemovedFromThreadEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatParticipantRemovedFromThreadWithUserEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadCreatedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadCreatedWithUserEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadDeletedEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatMessageEditedEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatMessageEditedInThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatMessageDeletedEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatMessageDeletedInThreadEventData))] [ModelReaderWriterBuildable(typeof(AcsChatThreadEventBaseProperties))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadEventInThreadBaseProperties))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadCreatedWithUserEventData))] [ModelReaderWriterBuildable(typeof(AcsChatThreadParticipantProperties))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadPropertiesUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadPropertiesUpdatedPerUserEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadEventInThreadBaseProperties))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadCreatedEventData))] [ModelReaderWriterBuildable(typeof(AcsChatThreadWithUserDeletedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatTypingIndicatorReceivedInThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadDeletedEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadPropertiesUpdatedPerUserEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadPropertiesUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatParticipantAddedToThreadWithUserEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatParticipantRemovedFromThreadWithUserEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatParticipantAddedToThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatParticipantRemovedFromThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsSmsEventBaseProperties))] + [ModelReaderWriterBuildable(typeof(AcsSmsDeliveryReportReceivedEventData))] + [ModelReaderWriterBuildable(typeof(AcsSmsDeliveryAttemptProperties))] + [ModelReaderWriterBuildable(typeof(AcsSmsReceivedEventData))] + [ModelReaderWriterBuildable(typeof(AcsRecordingFileStatusUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(AcsRecordingStorageInfoProperties))] + [ModelReaderWriterBuildable(typeof(AcsRecordingChunkInfoProperties))] [ModelReaderWriterBuildable(typeof(AcsEmailDeliveryReportReceivedEventData))] [ModelReaderWriterBuildable(typeof(AcsEmailDeliveryReportStatusDetails))] [ModelReaderWriterBuildable(typeof(AcsEmailEngagementTrackingReportReceivedEventData))] - [ModelReaderWriterBuildable(typeof(AcsIncomingCallCustomContext))] - [ModelReaderWriterBuildable(typeof(AcsIncomingCallEventData))] - [ModelReaderWriterBuildable(typeof(AcsMessageButtonContent))] - [ModelReaderWriterBuildable(typeof(AcsMessageChannelEventError))] - [ModelReaderWriterBuildable(typeof(AcsMessageContext))] - [ModelReaderWriterBuildable(typeof(AcsMessageDeliveryStatusUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AcsMessageEventData))] - [ModelReaderWriterBuildable(typeof(AcsMessageInteractiveButtonReplyContent))] - [ModelReaderWriterBuildable(typeof(AcsMessageInteractiveContent))] - [ModelReaderWriterBuildable(typeof(AcsMessageInteractiveListReplyContent))] - [ModelReaderWriterBuildable(typeof(AcsMessageMediaContent))] - [ModelReaderWriterBuildable(typeof(AcsMessageReactionContent))] - [ModelReaderWriterBuildable(typeof(AcsMessageReceivedEventData))] - [ModelReaderWriterBuildable(typeof(AcsMicrosoftTeamsAppIdentifier))] - [ModelReaderWriterBuildable(typeof(AcsRecordingChunkInfoProperties))] - [ModelReaderWriterBuildable(typeof(AcsRecordingFileStatusUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AcsRecordingStorageInfoProperties))] - [ModelReaderWriterBuildable(typeof(AcsRouterChannelConfiguration))] - [ModelReaderWriterBuildable(typeof(AcsRouterCommunicationError))] [ModelReaderWriterBuildable(typeof(AcsRouterEventData))] + [ModelReaderWriterBuildable(typeof(AcsRouterJobEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobCancelledEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobClassificationFailedEventData))] + [ModelReaderWriterBuildable(typeof(AcsRouterCommunicationError))] [ModelReaderWriterBuildable(typeof(AcsRouterJobClassifiedEventData))] + [ModelReaderWriterBuildable(typeof(AcsRouterQueueDetails))] + [ModelReaderWriterBuildable(typeof(AcsRouterWorkerSelector))] [ModelReaderWriterBuildable(typeof(AcsRouterJobClosedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobCompletedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobDeletedEventData))] - [ModelReaderWriterBuildable(typeof(AcsRouterJobEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobExceptionTriggeredEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobQueuedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobReceivedEventData))] @@ -86,223 +142,167 @@ namespace Azure.Messaging.EventGrid.SystemEvents [ModelReaderWriterBuildable(typeof(AcsRouterJobUnassignedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobWaitingForActivationEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterJobWorkerSelectorsExpiredEventData))] - [ModelReaderWriterBuildable(typeof(AcsRouterQueueDetails))] + [ModelReaderWriterBuildable(typeof(AcsRouterWorkerEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerDeletedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerDeregisteredEventData))] - [ModelReaderWriterBuildable(typeof(AcsRouterWorkerEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerOfferAcceptedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerOfferDeclinedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerOfferExpiredEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerOfferIssuedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerOfferRevokedEventData))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerRegisteredEventData))] - [ModelReaderWriterBuildable(typeof(AcsRouterWorkerSelector))] + [ModelReaderWriterBuildable(typeof(AcsRouterChannelConfiguration))] [ModelReaderWriterBuildable(typeof(AcsRouterWorkerUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AcsSmsDeliveryAttemptProperties))] - [ModelReaderWriterBuildable(typeof(AcsSmsDeliveryReportReceivedEventData))] - [ModelReaderWriterBuildable(typeof(AcsSmsEventBaseProperties))] - [ModelReaderWriterBuildable(typeof(AcsSmsReceivedEventData))] - [ModelReaderWriterBuildable(typeof(AcsUserDisconnectedEventData))] - [ModelReaderWriterBuildable(typeof(ApiCenterApiDefinitionAddedEventData))] - [ModelReaderWriterBuildable(typeof(ApiCenterApiDefinitionUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiCenterApiSpecification))] - [ModelReaderWriterBuildable(typeof(ApiManagementApiCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementApiDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementApiReleaseCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementApiReleaseDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementApiReleaseUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementApiUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementCircuitBreakerClosedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementCircuitBreakerOpenedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementCircuitBreakerProperties))] - [ModelReaderWriterBuildable(typeof(ApiManagementExpiredGatewayTokenProperties))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayApiAddedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayApiRemovedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCertificateAuthorityCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCertificateAuthorityDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCertificateAuthorityUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayHostnameConfigurationCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayHostnameConfigurationDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayHostnameConfigurationUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayProperties))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayTokenExpiredEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayTokenNearExpiryEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayTokenNearExpiryProperties))] - [ModelReaderWriterBuildable(typeof(ApiManagementGatewayUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementProductCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementProductDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementProductUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementSubscriptionCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementSubscriptionDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementSubscriptionUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementUserCreatedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementUserDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ApiManagementUserUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AppConfigurationKeyValueDeletedEventData))] - [ModelReaderWriterBuildable(typeof(AppConfigurationKeyValueModifiedEventData))] - [ModelReaderWriterBuildable(typeof(AppConfigurationSnapshotCreatedEventData))] - [ModelReaderWriterBuildable(typeof(AppConfigurationSnapshotEventData))] - [ModelReaderWriterBuildable(typeof(AppConfigurationSnapshotModifiedEventData))] - [ModelReaderWriterBuildable(typeof(AppEventTypeDetail))] - [ModelReaderWriterBuildable(typeof(AppServicePlanEventTypeDetail))] - [ModelReaderWriterBuildable(typeof(AvsClusterCreatedEventData))] - [ModelReaderWriterBuildable(typeof(AvsClusterDeletedEventData))] - [ModelReaderWriterBuildable(typeof(AvsClusterEventData))] - [ModelReaderWriterBuildable(typeof(AvsClusterFailedEventData))] - [ModelReaderWriterBuildable(typeof(AvsClusterUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AvsClusterUpdatingEventData))] - [ModelReaderWriterBuildable(typeof(AvsPrivateCloudEventData))] - [ModelReaderWriterBuildable(typeof(AvsPrivateCloudFailedEventData))] - [ModelReaderWriterBuildable(typeof(AvsPrivateCloudUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(AvsPrivateCloudUpdatingEventData))] - [ModelReaderWriterBuildable(typeof(AvsScriptExecutionCancelledEventData))] - [ModelReaderWriterBuildable(typeof(AvsScriptExecutionEventData))] - [ModelReaderWriterBuildable(typeof(AvsScriptExecutionFailedEventData))] - [ModelReaderWriterBuildable(typeof(AvsScriptExecutionFinishedEventData))] - [ModelReaderWriterBuildable(typeof(AvsScriptExecutionStartedEventData))] - [ModelReaderWriterBuildable(typeof(CommunicationIdentifierModel))] - [ModelReaderWriterBuildable(typeof(CommunicationUserIdentifierModel))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryArtifactEventData))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryArtifactEventTarget))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryChartDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryChartPushedEventData))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryEventActor))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryEventConnectedRegistry))] + [ModelReaderWriterBuildable(typeof(AcsMessageEventData))] + [ModelReaderWriterBuildable(typeof(AcsMessageChannelEventError))] + [ModelReaderWriterBuildable(typeof(AcsMessageDeliveryStatusUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(AcsMessageReceivedEventData))] + [ModelReaderWriterBuildable(typeof(AcsMessageMediaContent))] + [ModelReaderWriterBuildable(typeof(AcsMessageReactionContent))] + [ModelReaderWriterBuildable(typeof(AcsMessageContext))] + [ModelReaderWriterBuildable(typeof(AcsMessageButtonContent))] + [ModelReaderWriterBuildable(typeof(AcsMessageInteractiveContent))] + [ModelReaderWriterBuildable(typeof(AcsMessageInteractiveButtonReplyContent))] + [ModelReaderWriterBuildable(typeof(AcsMessageInteractiveListReplyContent))] [ModelReaderWriterBuildable(typeof(ContainerRegistryEventData))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryEventTarget))] [ModelReaderWriterBuildable(typeof(ContainerRegistryEventRequest))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryEventActor))] [ModelReaderWriterBuildable(typeof(ContainerRegistryEventSource))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryEventTarget))] - [ModelReaderWriterBuildable(typeof(ContainerRegistryImageDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryEventConnectedRegistry))] [ModelReaderWriterBuildable(typeof(ContainerRegistryImagePushedEventData))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryImageDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryArtifactEventData))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryArtifactEventTarget))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryChartPushedEventData))] + [ModelReaderWriterBuildable(typeof(ContainerRegistryChartDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ContainerServiceNewKubernetesVersionAvailableEventData))] + [ModelReaderWriterBuildable(typeof(ContainerServiceClusterSupportEventData))] [ModelReaderWriterBuildable(typeof(ContainerServiceClusterSupportEndedEventData))] [ModelReaderWriterBuildable(typeof(ContainerServiceClusterSupportEndingEventData))] - [ModelReaderWriterBuildable(typeof(ContainerServiceClusterSupportEventData))] - [ModelReaderWriterBuildable(typeof(ContainerServiceNewKubernetesVersionAvailableEventData))] [ModelReaderWriterBuildable(typeof(ContainerServiceNodePoolRollingEventData))] - [ModelReaderWriterBuildable(typeof(ContainerServiceNodePoolRollingFailedEventData))] [ModelReaderWriterBuildable(typeof(ContainerServiceNodePoolRollingStartedEventData))] [ModelReaderWriterBuildable(typeof(ContainerServiceNodePoolRollingSucceededEventData))] - [ModelReaderWriterBuildable(typeof(DataBoxCopyCompletedEventData))] + [ModelReaderWriterBuildable(typeof(ContainerServiceNodePoolRollingFailedEventData))] [ModelReaderWriterBuildable(typeof(DataBoxCopyStartedEventData))] + [ModelReaderWriterBuildable(typeof(DataBoxCopyCompletedEventData))] [ModelReaderWriterBuildable(typeof(DataBoxOrderCompletedEventData))] - [ModelReaderWriterBuildable(typeof(DeviceConnectionStateEventInfo))] - [ModelReaderWriterBuildable(typeof(DeviceConnectionStateEventProperties))] + [ModelReaderWriterBuildable(typeof(EdgeSolutionVersionPublishedEventData))] + [ModelReaderWriterBuildable(typeof(EventHubCaptureFileCreatedEventData))] + [ModelReaderWriterBuildable(typeof(MapsGeofenceEventProperties))] + [ModelReaderWriterBuildable(typeof(MapsGeofenceGeometry))] + [ModelReaderWriterBuildable(typeof(MapsGeofenceEnteredEventData))] + [ModelReaderWriterBuildable(typeof(MapsGeofenceExitedEventData))] + [ModelReaderWriterBuildable(typeof(MapsGeofenceResultEventData))] [ModelReaderWriterBuildable(typeof(DeviceLifeCycleEventProperties))] - [ModelReaderWriterBuildable(typeof(DeviceTelemetryEventProperties))] [ModelReaderWriterBuildable(typeof(DeviceTwinInfo))] [ModelReaderWriterBuildable(typeof(DeviceTwinInfoProperties))] - [ModelReaderWriterBuildable(typeof(DeviceTwinInfoX509Thumbprint))] - [ModelReaderWriterBuildable(typeof(DeviceTwinMetadata))] [ModelReaderWriterBuildable(typeof(DeviceTwinProperties))] - [ModelReaderWriterBuildable(typeof(EdgeSolutionVersionPublishedEventData))] - [ModelReaderWriterBuildable(typeof(EventGridMqttClientCreatedOrUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(EventGridMqttClientDeletedEventData))] - [ModelReaderWriterBuildable(typeof(EventGridMqttClientEventData))] - [ModelReaderWriterBuildable(typeof(EventGridMqttClientSessionConnectedEventData))] - [ModelReaderWriterBuildable(typeof(EventGridMqttClientSessionDisconnectedEventData))] - [ModelReaderWriterBuildable(typeof(EventHubCaptureFileCreatedEventData))] - [ModelReaderWriterBuildable(typeof(HealthcareDicomImageCreatedEventData))] - [ModelReaderWriterBuildable(typeof(HealthcareDicomImageDeletedEventData))] - [ModelReaderWriterBuildable(typeof(HealthcareDicomImageUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(HealthcareFhirResourceCreatedEventData))] - [ModelReaderWriterBuildable(typeof(HealthcareFhirResourceDeletedEventData))] - [ModelReaderWriterBuildable(typeof(HealthcareFhirResourceUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(IotHubDeviceConnectedEventData))] + [ModelReaderWriterBuildable(typeof(DeviceTwinMetadata))] + [ModelReaderWriterBuildable(typeof(DeviceTwinInfoX509Thumbprint))] + [ModelReaderWriterBuildable(typeof(DeviceConnectionStateEventProperties))] + [ModelReaderWriterBuildable(typeof(DeviceConnectionStateEventInfo))] + [ModelReaderWriterBuildable(typeof(DeviceTelemetryEventProperties))] [ModelReaderWriterBuildable(typeof(IotHubDeviceCreatedEventData))] [ModelReaderWriterBuildable(typeof(IotHubDeviceDeletedEventData))] + [ModelReaderWriterBuildable(typeof(IotHubDeviceConnectedEventData))] [ModelReaderWriterBuildable(typeof(IotHubDeviceDisconnectedEventData))] [ModelReaderWriterBuildable(typeof(IotHubDeviceTelemetryEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultAccessPolicyChangedEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultCertificateExpiredEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultCertificateNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(HealthcareFhirResourceCreatedEventData))] + [ModelReaderWriterBuildable(typeof(HealthcareFhirResourceUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(HealthcareFhirResourceDeletedEventData))] + [ModelReaderWriterBuildable(typeof(HealthcareDicomImageCreatedEventData))] + [ModelReaderWriterBuildable(typeof(HealthcareDicomImageDeletedEventData))] + [ModelReaderWriterBuildable(typeof(HealthcareDicomImageUpdatedEventData))] [ModelReaderWriterBuildable(typeof(KeyVaultCertificateNewVersionCreatedEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultKeyExpiredEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultKeyNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultCertificateNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultCertificateExpiredEventData))] [ModelReaderWriterBuildable(typeof(KeyVaultKeyNewVersionCreatedEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultSecretExpiredEventData))] - [ModelReaderWriterBuildable(typeof(KeyVaultSecretNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultKeyNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultKeyExpiredEventData))] [ModelReaderWriterBuildable(typeof(KeyVaultSecretNewVersionCreatedEventData))] - [ModelReaderWriterBuildable(typeof(MachineLearningServicesDatasetDriftDetectedEventData))] - [ModelReaderWriterBuildable(typeof(MachineLearningServicesModelDeployedEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultSecretNearExpiryEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultSecretExpiredEventData))] + [ModelReaderWriterBuildable(typeof(KeyVaultAccessPolicyChangedEventData))] [ModelReaderWriterBuildable(typeof(MachineLearningServicesModelRegisteredEventData))] + [ModelReaderWriterBuildable(typeof(MachineLearningServicesModelDeployedEventData))] [ModelReaderWriterBuildable(typeof(MachineLearningServicesRunCompletedEventData))] + [ModelReaderWriterBuildable(typeof(MachineLearningServicesDatasetDriftDetectedEventData))] [ModelReaderWriterBuildable(typeof(MachineLearningServicesRunStatusChangedEventData))] - [ModelReaderWriterBuildable(typeof(MapsGeofenceEnteredEventData))] - [ModelReaderWriterBuildable(typeof(MapsGeofenceEventProperties))] - [ModelReaderWriterBuildable(typeof(MapsGeofenceExitedEventData))] - [ModelReaderWriterBuildable(typeof(MapsGeofenceGeometry))] - [ModelReaderWriterBuildable(typeof(MapsGeofenceResultEventData))] - [ModelReaderWriterBuildable(typeof(MicrosoftTeamsUserIdentifierModel))] - [ModelReaderWriterBuildable(typeof(PhoneNumberIdentifierModel))] - [ModelReaderWriterBuildable(typeof(PolicyInsightsPolicyStateChangedEventData))] [ModelReaderWriterBuildable(typeof(PolicyInsightsPolicyStateCreatedEventData))] + [ModelReaderWriterBuildable(typeof(PolicyInsightsPolicyStateChangedEventData))] [ModelReaderWriterBuildable(typeof(PolicyInsightsPolicyStateDeletedEventData))] - [ModelReaderWriterBuildable(typeof(RedisExportRdbCompletedEventData))] - [ModelReaderWriterBuildable(typeof(RedisImportRdbCompletedEventData))] [ModelReaderWriterBuildable(typeof(RedisPatchingCompletedEventData))] [ModelReaderWriterBuildable(typeof(RedisScalingCompletedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceActionCancelEventData))] - [ModelReaderWriterBuildable(typeof(ResourceActionFailureEventData))] - [ModelReaderWriterBuildable(typeof(ResourceActionSuccessEventData))] + [ModelReaderWriterBuildable(typeof(RedisExportRdbCompletedEventData))] + [ModelReaderWriterBuildable(typeof(RedisImportRdbCompletedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceWriteSuccessEventData))] [ModelReaderWriterBuildable(typeof(ResourceAuthorization))] - [ModelReaderWriterBuildable(typeof(ResourceDeleteCancelEventData))] - [ModelReaderWriterBuildable(typeof(ResourceDeleteFailureEventData))] - [ModelReaderWriterBuildable(typeof(ResourceDeleteSuccessEventData))] [ModelReaderWriterBuildable(typeof(ResourceHttpRequest))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsContainerServiceEventResourcesScheduledEventData))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsHealthResourcesAnnotatedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsOperationalDetails))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceDeletedDetails))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceManagementCreatedOrUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceManagementDeletedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceUpdatedDetails))] - [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceWriteCancelEventData))] [ModelReaderWriterBuildable(typeof(ResourceWriteFailureEventData))] - [ModelReaderWriterBuildable(typeof(ResourceWriteSuccessEventData))] - [ModelReaderWriterBuildable(typeof(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData))] + [ModelReaderWriterBuildable(typeof(ResourceWriteCancelEventData))] + [ModelReaderWriterBuildable(typeof(ResourceDeleteSuccessEventData))] + [ModelReaderWriterBuildable(typeof(ResourceDeleteFailureEventData))] + [ModelReaderWriterBuildable(typeof(ResourceDeleteCancelEventData))] + [ModelReaderWriterBuildable(typeof(ResourceActionSuccessEventData))] + [ModelReaderWriterBuildable(typeof(ResourceActionFailureEventData))] + [ModelReaderWriterBuildable(typeof(ResourceActionCancelEventData))] [ModelReaderWriterBuildable(typeof(ServiceBusActiveMessagesAvailableWithNoListenersEventData))] - [ModelReaderWriterBuildable(typeof(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData))] [ModelReaderWriterBuildable(typeof(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData))] + [ModelReaderWriterBuildable(typeof(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData))] + [ModelReaderWriterBuildable(typeof(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData))] [ModelReaderWriterBuildable(typeof(SignalRServiceClientConnectionConnectedEventData))] [ModelReaderWriterBuildable(typeof(SignalRServiceClientConnectionDisconnectedEventData))] - [ModelReaderWriterBuildable(typeof(StorageAsyncOperationInitiatedEventData))] [ModelReaderWriterBuildable(typeof(StorageBlobCreatedEventData))] [ModelReaderWriterBuildable(typeof(StorageBlobDeletedEventData))] - [ModelReaderWriterBuildable(typeof(StorageBlobInventoryPolicyCompletedEventData))] - [ModelReaderWriterBuildable(typeof(StorageBlobRenamedEventData))] - [ModelReaderWriterBuildable(typeof(StorageBlobTierChangedEventData))] [ModelReaderWriterBuildable(typeof(StorageDirectoryCreatedEventData))] [ModelReaderWriterBuildable(typeof(StorageDirectoryDeletedEventData))] + [ModelReaderWriterBuildable(typeof(StorageBlobRenamedEventData))] [ModelReaderWriterBuildable(typeof(StorageDirectoryRenamedEventData))] - [ModelReaderWriterBuildable(typeof(StorageLifecyclePolicyActionSummaryDetail))] [ModelReaderWriterBuildable(typeof(StorageLifecyclePolicyCompletedEventData))] [ModelReaderWriterBuildable(typeof(StorageLifecyclePolicyRunSummary))] - [ModelReaderWriterBuildable(typeof(StorageTaskAssignmentCompletedEventData))] - [ModelReaderWriterBuildable(typeof(StorageTaskAssignmentQueuedEventData))] + [ModelReaderWriterBuildable(typeof(StorageLifecyclePolicyActionSummaryDetail))] + [ModelReaderWriterBuildable(typeof(StorageBlobTierChangedEventData))] + [ModelReaderWriterBuildable(typeof(StorageAsyncOperationInitiatedEventData))] + [ModelReaderWriterBuildable(typeof(StorageBlobInventoryPolicyCompletedEventData))] [ModelReaderWriterBuildable(typeof(StorageTaskCompletedEventData))] [ModelReaderWriterBuildable(typeof(StorageTaskQueuedEventData))] - [ModelReaderWriterBuildable(typeof(SubscriptionDeletedEventData))] - [ModelReaderWriterBuildable(typeof(SubscriptionValidationEventData))] - [ModelReaderWriterBuildable(typeof(SubscriptionValidationResponse))] - [ModelReaderWriterBuildable(typeof(WebAppServicePlanUpdatedEventData))] - [ModelReaderWriterBuildable(typeof(WebAppServicePlanUpdatedEventDataSku))] + [ModelReaderWriterBuildable(typeof(StorageTaskAssignmentQueuedEventData))] + [ModelReaderWriterBuildable(typeof(StorageTaskAssignmentCompletedEventData))] + [ModelReaderWriterBuildable(typeof(AppEventTypeDetail))] [ModelReaderWriterBuildable(typeof(WebAppUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(WebBackupOperationStartedEventData))] [ModelReaderWriterBuildable(typeof(WebBackupOperationCompletedEventData))] [ModelReaderWriterBuildable(typeof(WebBackupOperationFailedEventData))] - [ModelReaderWriterBuildable(typeof(WebBackupOperationStartedEventData))] + [ModelReaderWriterBuildable(typeof(WebRestoreOperationStartedEventData))] [ModelReaderWriterBuildable(typeof(WebRestoreOperationCompletedEventData))] [ModelReaderWriterBuildable(typeof(WebRestoreOperationFailedEventData))] - [ModelReaderWriterBuildable(typeof(WebRestoreOperationStartedEventData))] + [ModelReaderWriterBuildable(typeof(WebSlotSwapStartedEventData))] [ModelReaderWriterBuildable(typeof(WebSlotSwapCompletedEventData))] [ModelReaderWriterBuildable(typeof(WebSlotSwapFailedEventData))] - [ModelReaderWriterBuildable(typeof(WebSlotSwapStartedEventData))] - [ModelReaderWriterBuildable(typeof(WebSlotSwapWithPreviewCancelledEventData))] [ModelReaderWriterBuildable(typeof(WebSlotSwapWithPreviewStartedEventData))] + [ModelReaderWriterBuildable(typeof(WebSlotSwapWithPreviewCancelledEventData))] + [ModelReaderWriterBuildable(typeof(WebAppServicePlanUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(AppServicePlanEventTypeDetail))] + [ModelReaderWriterBuildable(typeof(WebAppServicePlanUpdatedEventDataSku))] + [ModelReaderWriterBuildable(typeof(SubscriptionValidationEventData))] + [ModelReaderWriterBuildable(typeof(SubscriptionValidationResponse))] + [ModelReaderWriterBuildable(typeof(SubscriptionDeletedEventData))] + [ModelReaderWriterBuildable(typeof(EventGridMqttClientEventData))] + [ModelReaderWriterBuildable(typeof(EventGridMqttClientCreatedOrUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(EventGridMqttClientDeletedEventData))] + [ModelReaderWriterBuildable(typeof(EventGridMqttClientSessionConnectedEventData))] + [ModelReaderWriterBuildable(typeof(EventGridMqttClientSessionDisconnectedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceUpdatedDetails))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsOperationalDetails))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsHealthResourcesAnnotatedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceDeletedDetails))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceManagementCreatedOrUpdatedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsResourceManagementDeletedEventData))] + [ModelReaderWriterBuildable(typeof(ResourceNotificationsContainerServiceEventResourcesScheduledEventData))] public partial class AzureMessagingEventGridSystemEventsContext : ModelReaderWriterContext { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.Serialization.cs index ff71c3148f1f..43f1b2f1aab4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class PhoneNumberIdentifierModel : IUtf8JsonSerializable, IJsonModel + /// A phone number. + public partial class PhoneNumberIdentifierModel : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal PhoneNumberIdentifierModel() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +33,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PhoneNumberIdentifierModel)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStringValue(Value); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - PhoneNumberIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + PhoneNumberIdentifierModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual PhoneNumberIdentifierModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PhoneNumberIdentifierModel)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializePhoneNumberIdentifierModel(document.RootElement, options); } - internal static PhoneNumberIdentifierModel DeserializePhoneNumberIdentifierModel(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static PhoneNumberIdentifierModel DeserializePhoneNumberIdentifierModel(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - value = property.Value.GetString(); + value = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new PhoneNumberIdentifierModel(value, serializedAdditionalRawData); + return new PhoneNumberIdentifierModel(value, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - PhoneNumberIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + PhoneNumberIdentifierModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual PhoneNumberIdentifierModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializePhoneNumberIdentifierModel(document.RootElement, options); } default: @@ -121,22 +136,7 @@ PhoneNumberIdentifierModel IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static PhoneNumberIdentifierModel FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhoneNumberIdentifierModel(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.cs index fab888938068..ec90d9130c2b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PhoneNumberIdentifierModel.cs @@ -13,60 +13,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// A phone number. public partial class PhoneNumberIdentifierModel { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The phone number in E.164 format. - /// is null. internal PhoneNumberIdentifierModel(string value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value; } /// Initializes a new instance of . /// The phone number in E.164 format. - /// Keeps track of any properties unknown to the library. - internal PhoneNumberIdentifierModel(string value, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal PhoneNumberIdentifierModel(string value, IDictionary additionalBinaryDataProperties) { Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PhoneNumberIdentifierModel() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The phone number in E.164 format. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs index c82b9744b8d9..d6da6f1c393d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event. [JsonConverter(typeof(PolicyInsightsPolicyStateChangedEventDataConverter))] - public partial class PolicyInsightsPolicyStateChangedEventData : IUtf8JsonSerializable, IJsonModel + public partial class PolicyInsightsPolicyStateChangedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal PolicyInsightsPolicyStateChangedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateChangedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -53,15 +57,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(SubscriptionId); writer.WritePropertyName("complianceReasonCode"u8); writer.WriteStringValue(ComplianceReasonCode); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -70,22 +74,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - PolicyInsightsPolicyStateChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + PolicyInsightsPolicyStateChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual PolicyInsightsPolicyStateChangedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateChangedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializePolicyInsightsPolicyStateChangedEventData(document.RootElement, options); } - internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsightsPolicyStateChangedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsightsPolicyStateChangedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -97,55 +106,53 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig string complianceState = default; string subscriptionId = default; string complianceReasonCode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("policyAssignmentId"u8)) + if (prop.NameEquals("policyAssignmentId"u8)) { - policyAssignmentId = property.Value.GetString(); + policyAssignmentId = prop.Value.GetString(); continue; } - if (property.NameEquals("policyDefinitionId"u8)) + if (prop.NameEquals("policyDefinitionId"u8)) { - policyDefinitionId = property.Value.GetString(); + policyDefinitionId = prop.Value.GetString(); continue; } - if (property.NameEquals("policyDefinitionReferenceId"u8)) + if (prop.NameEquals("policyDefinitionReferenceId"u8)) { - policyDefinitionReferenceId = property.Value.GetString(); + policyDefinitionReferenceId = prop.Value.GetString(); continue; } - if (property.NameEquals("complianceState"u8)) + if (prop.NameEquals("complianceState"u8)) { - complianceState = property.Value.GetString(); + complianceState = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("complianceReasonCode"u8)) + if (prop.NameEquals("complianceReasonCode"u8)) { - complianceReasonCode = property.Value.GetString(); + complianceReasonCode = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new PolicyInsightsPolicyStateChangedEventData( timestamp, policyAssignmentId, @@ -154,13 +161,16 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig complianceState, subscriptionId, complianceReasonCode, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -170,15 +180,20 @@ BinaryData IPersistableModel.Write(Mo } } - PolicyInsightsPolicyStateChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + PolicyInsightsPolicyStateChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual PolicyInsightsPolicyStateChangedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializePolicyInsightsPolicyStateChangedEventData(document.RootElement, options); } default: @@ -186,35 +201,28 @@ PolicyInsightsPolicyStateChangedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static PolicyInsightsPolicyStateChangedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePolicyInsightsPolicyStateChangedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class PolicyInsightsPolicyStateChangedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, PolicyInsightsPolicyStateChangedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override PolicyInsightsPolicyStateChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializePolicyInsightsPolicyStateChangedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyInsightsPolicyStateChangedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs index 093ecda00eab..3133c4190cc0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event. public partial class PolicyInsightsPolicyStateChangedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The resource ID of the policy assignment. @@ -52,16 +23,8 @@ public partial class PolicyInsightsPolicyStateChangedEventData /// The compliance state of the resource with respect to the policy assignment. /// The subscription ID of the resource. /// The compliance reason code. May be empty. - /// , , , , or is null. internal PolicyInsightsPolicyStateChangedEventData(string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode) { - Argument.AssertNotNull(policyAssignmentId, nameof(policyAssignmentId)); - Argument.AssertNotNull(policyDefinitionId, nameof(policyDefinitionId)); - Argument.AssertNotNull(policyDefinitionReferenceId, nameof(policyDefinitionReferenceId)); - Argument.AssertNotNull(complianceState, nameof(complianceState)); - Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(complianceReasonCode, nameof(complianceReasonCode)); - PolicyAssignmentId = policyAssignmentId; PolicyDefinitionId = policyDefinitionId; PolicyDefinitionReferenceId = policyDefinitionReferenceId; @@ -78,8 +41,8 @@ internal PolicyInsightsPolicyStateChangedEventData(string policyAssignmentId, st /// The compliance state of the resource with respect to the policy assignment. /// The subscription ID of the resource. /// The compliance reason code. May be empty. - /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -88,26 +51,27 @@ internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp, st ComplianceState = complianceState; SubscriptionId = subscriptionId; ComplianceReasonCode = complianceReasonCode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateChangedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. public DateTimeOffset? Timestamp { get; } + /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } + /// The resource ID of the policy definition. public string PolicyDefinitionId { get; } + /// The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. public string PolicyDefinitionReferenceId { get; } + /// The compliance state of the resource with respect to the policy assignment. public string ComplianceState { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The compliance reason code. May be empty. public string ComplianceReasonCode { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs index 396797c086b3..9b260c3f24c9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event. [JsonConverter(typeof(PolicyInsightsPolicyStateCreatedEventDataConverter))] - public partial class PolicyInsightsPolicyStateCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class PolicyInsightsPolicyStateCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal PolicyInsightsPolicyStateCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -53,15 +57,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(SubscriptionId); writer.WritePropertyName("complianceReasonCode"u8); writer.WriteStringValue(ComplianceReasonCode); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -70,22 +74,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - PolicyInsightsPolicyStateCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + PolicyInsightsPolicyStateCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual PolicyInsightsPolicyStateCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializePolicyInsightsPolicyStateCreatedEventData(document.RootElement, options); } - internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsightsPolicyStateCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsightsPolicyStateCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -97,55 +106,53 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig string complianceState = default; string subscriptionId = default; string complianceReasonCode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("policyAssignmentId"u8)) + if (prop.NameEquals("policyAssignmentId"u8)) { - policyAssignmentId = property.Value.GetString(); + policyAssignmentId = prop.Value.GetString(); continue; } - if (property.NameEquals("policyDefinitionId"u8)) + if (prop.NameEquals("policyDefinitionId"u8)) { - policyDefinitionId = property.Value.GetString(); + policyDefinitionId = prop.Value.GetString(); continue; } - if (property.NameEquals("policyDefinitionReferenceId"u8)) + if (prop.NameEquals("policyDefinitionReferenceId"u8)) { - policyDefinitionReferenceId = property.Value.GetString(); + policyDefinitionReferenceId = prop.Value.GetString(); continue; } - if (property.NameEquals("complianceState"u8)) + if (prop.NameEquals("complianceState"u8)) { - complianceState = property.Value.GetString(); + complianceState = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("complianceReasonCode"u8)) + if (prop.NameEquals("complianceReasonCode"u8)) { - complianceReasonCode = property.Value.GetString(); + complianceReasonCode = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new PolicyInsightsPolicyStateCreatedEventData( timestamp, policyAssignmentId, @@ -154,13 +161,16 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig complianceState, subscriptionId, complianceReasonCode, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -170,15 +180,20 @@ BinaryData IPersistableModel.Write(Mo } } - PolicyInsightsPolicyStateCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + PolicyInsightsPolicyStateCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual PolicyInsightsPolicyStateCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializePolicyInsightsPolicyStateCreatedEventData(document.RootElement, options); } default: @@ -186,35 +201,28 @@ PolicyInsightsPolicyStateCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static PolicyInsightsPolicyStateCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePolicyInsightsPolicyStateCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class PolicyInsightsPolicyStateCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, PolicyInsightsPolicyStateCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override PolicyInsightsPolicyStateCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializePolicyInsightsPolicyStateCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyInsightsPolicyStateCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs index 43813c104c61..0507e18bc999 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event. public partial class PolicyInsightsPolicyStateCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The resource ID of the policy assignment. @@ -52,16 +23,8 @@ public partial class PolicyInsightsPolicyStateCreatedEventData /// The compliance state of the resource with respect to the policy assignment. /// The subscription ID of the resource. /// The compliance reason code. May be empty. - /// , , , , or is null. internal PolicyInsightsPolicyStateCreatedEventData(string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode) { - Argument.AssertNotNull(policyAssignmentId, nameof(policyAssignmentId)); - Argument.AssertNotNull(policyDefinitionId, nameof(policyDefinitionId)); - Argument.AssertNotNull(policyDefinitionReferenceId, nameof(policyDefinitionReferenceId)); - Argument.AssertNotNull(complianceState, nameof(complianceState)); - Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(complianceReasonCode, nameof(complianceReasonCode)); - PolicyAssignmentId = policyAssignmentId; PolicyDefinitionId = policyDefinitionId; PolicyDefinitionReferenceId = policyDefinitionReferenceId; @@ -78,8 +41,8 @@ internal PolicyInsightsPolicyStateCreatedEventData(string policyAssignmentId, st /// The compliance state of the resource with respect to the policy assignment. /// The subscription ID of the resource. /// The compliance reason code. May be empty. - /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -88,26 +51,27 @@ internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp, st ComplianceState = complianceState; SubscriptionId = subscriptionId; ComplianceReasonCode = complianceReasonCode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. public DateTimeOffset? Timestamp { get; } + /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } + /// The resource ID of the policy definition. public string PolicyDefinitionId { get; } + /// The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. public string PolicyDefinitionReferenceId { get; } + /// The compliance state of the resource with respect to the policy assignment. public string ComplianceState { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The compliance reason code. May be empty. public string ComplianceReasonCode { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs index 6964ccc96165..362fb10bb754 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event. [JsonConverter(typeof(PolicyInsightsPolicyStateDeletedEventDataConverter))] - public partial class PolicyInsightsPolicyStateDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class PolicyInsightsPolicyStateDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal PolicyInsightsPolicyStateDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -53,15 +57,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(SubscriptionId); writer.WritePropertyName("complianceReasonCode"u8); writer.WriteStringValue(ComplianceReasonCode); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -70,22 +74,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - PolicyInsightsPolicyStateDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + PolicyInsightsPolicyStateDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual PolicyInsightsPolicyStateDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializePolicyInsightsPolicyStateDeletedEventData(document.RootElement, options); } - internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsightsPolicyStateDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsightsPolicyStateDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -97,55 +106,53 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig string complianceState = default; string subscriptionId = default; string complianceReasonCode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("policyAssignmentId"u8)) + if (prop.NameEquals("policyAssignmentId"u8)) { - policyAssignmentId = property.Value.GetString(); + policyAssignmentId = prop.Value.GetString(); continue; } - if (property.NameEquals("policyDefinitionId"u8)) + if (prop.NameEquals("policyDefinitionId"u8)) { - policyDefinitionId = property.Value.GetString(); + policyDefinitionId = prop.Value.GetString(); continue; } - if (property.NameEquals("policyDefinitionReferenceId"u8)) + if (prop.NameEquals("policyDefinitionReferenceId"u8)) { - policyDefinitionReferenceId = property.Value.GetString(); + policyDefinitionReferenceId = prop.Value.GetString(); continue; } - if (property.NameEquals("complianceState"u8)) + if (prop.NameEquals("complianceState"u8)) { - complianceState = property.Value.GetString(); + complianceState = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("complianceReasonCode"u8)) + if (prop.NameEquals("complianceReasonCode"u8)) { - complianceReasonCode = property.Value.GetString(); + complianceReasonCode = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new PolicyInsightsPolicyStateDeletedEventData( timestamp, policyAssignmentId, @@ -154,13 +161,16 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig complianceState, subscriptionId, complianceReasonCode, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -170,15 +180,20 @@ BinaryData IPersistableModel.Write(Mo } } - PolicyInsightsPolicyStateDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + PolicyInsightsPolicyStateDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual PolicyInsightsPolicyStateDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializePolicyInsightsPolicyStateDeletedEventData(document.RootElement, options); } default: @@ -186,35 +201,28 @@ PolicyInsightsPolicyStateDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static PolicyInsightsPolicyStateDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePolicyInsightsPolicyStateDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class PolicyInsightsPolicyStateDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, PolicyInsightsPolicyStateDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override PolicyInsightsPolicyStateDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializePolicyInsightsPolicyStateDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyInsightsPolicyStateDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs index b26dfe458f22..e07ca5289474 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event. public partial class PolicyInsightsPolicyStateDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The resource ID of the policy assignment. @@ -52,16 +23,8 @@ public partial class PolicyInsightsPolicyStateDeletedEventData /// The compliance state of the resource with respect to the policy assignment. /// The subscription ID of the resource. /// The compliance reason code. May be empty. - /// , , , , or is null. internal PolicyInsightsPolicyStateDeletedEventData(string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode) { - Argument.AssertNotNull(policyAssignmentId, nameof(policyAssignmentId)); - Argument.AssertNotNull(policyDefinitionId, nameof(policyDefinitionId)); - Argument.AssertNotNull(policyDefinitionReferenceId, nameof(policyDefinitionReferenceId)); - Argument.AssertNotNull(complianceState, nameof(complianceState)); - Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(complianceReasonCode, nameof(complianceReasonCode)); - PolicyAssignmentId = policyAssignmentId; PolicyDefinitionId = policyDefinitionId; PolicyDefinitionReferenceId = policyDefinitionReferenceId; @@ -78,8 +41,8 @@ internal PolicyInsightsPolicyStateDeletedEventData(string policyAssignmentId, st /// The compliance state of the resource with respect to the policy assignment. /// The subscription ID of the resource. /// The compliance reason code. May be empty. - /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -88,26 +51,27 @@ internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp, st ComplianceState = complianceState; SubscriptionId = subscriptionId; ComplianceReasonCode = complianceReasonCode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. public DateTimeOffset? Timestamp { get; } + /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } + /// The resource ID of the policy definition. public string PolicyDefinitionId { get; } + /// The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. public string PolicyDefinitionReferenceId { get; } + /// The compliance state of the resource with respect to the policy assignment. public string ComplianceState { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The compliance reason code. May be empty. public string ComplianceReasonCode { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs index 9c73a66f35f9..db1a45731f43 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. [JsonConverter(typeof(RedisExportRdbCompletedEventDataConverter))] - public partial class RedisExportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisExportRdbCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -51,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("status"u8); writer.WriteStringValue(Status); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RedisExportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + RedisExportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual RedisExportRdbCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } - internal static RedisExportRdbCompletedEventData DeserializeRedisExportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static RedisExportRdbCompletedEventData DeserializeRedisExportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,42 +95,43 @@ internal static RedisExportRdbCompletedEventData DeserializeRedisExportRdbComple DateTimeOffset? timestamp = default; string name = default; string status = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisExportRdbCompletedEventData(timestamp, name, status, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - RedisExportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + RedisExportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual RedisExportRdbCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } default: @@ -152,35 +162,28 @@ RedisExportRdbCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RedisExportRdbCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRedisExportRdbCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class RedisExportRdbCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, RedisExportRdbCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override RedisExportRdbCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisExportRdbCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs index f689ff3f1242..73be16a2de08 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. public partial class RedisExportRdbCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal RedisExportRdbCompletedEventData() @@ -54,19 +25,21 @@ internal RedisExportRdbCompletedEventData() /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// Keeps track of any properties unknown to the library. - internal RedisExportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal RedisExportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; Name = name; Status = status; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The name of this event. public string Name { get; } + /// The status of this event. Failed or succeeded. public string Status { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs index 7b34c7f9a016..72b6951fd72a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. [JsonConverter(typeof(RedisImportRdbCompletedEventDataConverter))] - public partial class RedisImportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisImportRdbCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -51,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("status"u8); writer.WriteStringValue(Status); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RedisImportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + RedisImportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual RedisImportRdbCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } - internal static RedisImportRdbCompletedEventData DeserializeRedisImportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static RedisImportRdbCompletedEventData DeserializeRedisImportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,42 +95,43 @@ internal static RedisImportRdbCompletedEventData DeserializeRedisImportRdbComple DateTimeOffset? timestamp = default; string name = default; string status = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisImportRdbCompletedEventData(timestamp, name, status, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - RedisImportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + RedisImportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual RedisImportRdbCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } default: @@ -152,35 +162,28 @@ RedisImportRdbCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RedisImportRdbCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRedisImportRdbCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class RedisImportRdbCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, RedisImportRdbCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override RedisImportRdbCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisImportRdbCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs index 7381f6f760ab..b55ea163243a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. public partial class RedisImportRdbCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal RedisImportRdbCompletedEventData() @@ -54,19 +25,21 @@ internal RedisImportRdbCompletedEventData() /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// Keeps track of any properties unknown to the library. - internal RedisImportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal RedisImportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; Name = name; Status = status; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The name of this event. public string Name { get; } + /// The status of this event. Failed or succeeded. public string Status { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs index d8c3ad4adbe4..414b6369f250 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event. [JsonConverter(typeof(RedisPatchingCompletedEventDataConverter))] - public partial class RedisPatchingCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisPatchingCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisPatchingCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -51,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("status"u8); writer.WriteStringValue(Status); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RedisPatchingCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + RedisPatchingCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual RedisPatchingCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisPatchingCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeRedisPatchingCompletedEventData(document.RootElement, options); } - internal static RedisPatchingCompletedEventData DeserializeRedisPatchingCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static RedisPatchingCompletedEventData DeserializeRedisPatchingCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,42 +95,43 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete DateTimeOffset? timestamp = default; string name = default; string status = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new RedisPatchingCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisPatchingCompletedEventData(timestamp, name, status, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - RedisPatchingCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + RedisPatchingCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual RedisPatchingCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeRedisPatchingCompletedEventData(document.RootElement, options); } default: @@ -152,35 +162,28 @@ RedisPatchingCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RedisPatchingCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRedisPatchingCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class RedisPatchingCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, RedisPatchingCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override RedisPatchingCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisPatchingCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisPatchingCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs index 3cc0aee40d81..ab95b9611e7c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event. public partial class RedisPatchingCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal RedisPatchingCompletedEventData() @@ -54,19 +25,21 @@ internal RedisPatchingCompletedEventData() /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// Keeps track of any properties unknown to the library. - internal RedisPatchingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal RedisPatchingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; Name = name; Status = status; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The name of this event. public string Name { get; } + /// The status of this event. Failed or succeeded. public string Status { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs index 37034268e0e1..4594264bab71 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event. [JsonConverter(typeof(RedisScalingCompletedEventDataConverter))] - public partial class RedisScalingCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisScalingCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisScalingCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -51,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("status"u8); writer.WriteStringValue(Status); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +67,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RedisScalingCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + RedisScalingCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual RedisScalingCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RedisScalingCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeRedisScalingCompletedEventData(document.RootElement, options); } - internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,42 +95,43 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE DateTimeOffset? timestamp = default; string name = default; string status = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new RedisScalingCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisScalingCompletedEventData(timestamp, name, status, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -136,15 +141,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - RedisScalingCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + RedisScalingCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual RedisScalingCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeRedisScalingCompletedEventData(document.RootElement, options); } default: @@ -152,35 +162,28 @@ RedisScalingCompletedEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RedisScalingCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRedisScalingCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class RedisScalingCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, RedisScalingCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override RedisScalingCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisScalingCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisScalingCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs index ac341ec49072..0594c8951269 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event. public partial class RedisScalingCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal RedisScalingCompletedEventData() @@ -54,19 +25,21 @@ internal RedisScalingCompletedEventData() /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// Keeps track of any properties unknown to the library. - internal RedisScalingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal RedisScalingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; Name = name; Status = status; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The name of this event. public string Name { get; } + /// The status of this event. Failed or succeeded. public string Status { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs index a7f3e6327822..b2cf7a1dc744 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. [JsonConverter(typeof(ResourceActionCancelEventDataConverter))] - public partial class ResourceActionCancelEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceActionCancelEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceActionCancelEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceActionCancelEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceActionCancelEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceActionCancelEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceActionCancelEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceActionCancelEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceActionCancelEventData(document.RootElement, options); } - internal static ResourceActionCancelEventData DeserializeResourceActionCancelEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceActionCancelEventData DeserializeResourceActionCancelEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceActionCancelEventData DeserializeResourceActionCancelEve string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceActionCancelEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceActionCancelEventData DeserializeResourceActionCancelEve resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ResourceActionCancelEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceActionCancelEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceActionCancelEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceActionCancelEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceActionCancelEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceActionCancelEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceActionCancelEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceActionCancelEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceActionCancelEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceActionCancelEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceActionCancelEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceActionCancelEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs index 712f9e945aa1..eb6e8a5418ae 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. public partial class ResourceActionCancelEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceActionCancelEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceActionCancelEventData(JsonElement authorizationJson, JsonElemen /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceActionCancelEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceActionCancelEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceActionCancelEventData(string tenantId, string subscriptionId, s ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceActionCancelEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs index 6a89b49fbab0..b9a64ea0df14 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails. [JsonConverter(typeof(ResourceActionFailureEventDataConverter))] - public partial class ResourceActionFailureEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceActionFailureEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceActionFailureEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceActionFailureEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceActionFailureEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceActionFailureEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceActionFailureEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceActionFailureEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceActionFailureEventData(document.RootElement, options); } - internal static ResourceActionFailureEventData DeserializeResourceActionFailureEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceActionFailureEventData DeserializeResourceActionFailureEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceActionFailureEventData DeserializeResourceActionFailureE string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceActionFailureEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceActionFailureEventData DeserializeResourceActionFailureE resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - ResourceActionFailureEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceActionFailureEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceActionFailureEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceActionFailureEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceActionFailureEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceActionFailureEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceActionFailureEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceActionFailureEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceActionFailureEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceActionFailureEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceActionFailureEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceActionFailureEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs index 7fc8ced7c912..13ddbd6752ea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails. public partial class ResourceActionFailureEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceActionFailureEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceActionFailureEventData(JsonElement authorizationJson, JsonEleme /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceActionFailureEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceActionFailureEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceActionFailureEventData(string tenantId, string subscriptionId, ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceActionFailureEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs index 6af73537cb99..ee91556d95d2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds. [JsonConverter(typeof(ResourceActionSuccessEventDataConverter))] - public partial class ResourceActionSuccessEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceActionSuccessEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceActionSuccessEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceActionSuccessEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceActionSuccessEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceActionSuccessEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceActionSuccessEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceActionSuccessEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceActionSuccessEventData(document.RootElement, options); } - internal static ResourceActionSuccessEventData DeserializeResourceActionSuccessEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceActionSuccessEventData DeserializeResourceActionSuccessEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceActionSuccessEventData DeserializeResourceActionSuccessE string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceActionSuccessEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceActionSuccessEventData DeserializeResourceActionSuccessE resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - ResourceActionSuccessEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceActionSuccessEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceActionSuccessEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceActionSuccessEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceActionSuccessEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceActionSuccessEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceActionSuccessEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceActionSuccessEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceActionSuccessEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceActionSuccessEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceActionSuccessEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceActionSuccessEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs index ac5b44f5df96..449039214ff9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds. public partial class ResourceActionSuccessEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceActionSuccessEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceActionSuccessEventData(JsonElement authorizationJson, JsonEleme /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceActionSuccessEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceActionSuccessEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceActionSuccessEventData(string tenantId, string subscriptionId, ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceActionSuccessEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs index 37b8bffe51f0..242da330482a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ResourceAuthorization : IUtf8JsonSerializable, IJsonModel + /// The details of the authorization for the resource. + public partial class ResourceAuthorization : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceAuthorization() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceAuthorization)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Scope)) { writer.WritePropertyName("scope"u8); @@ -49,18 +53,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Evidence) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,66 +78,79 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceAuthorization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceAuthorization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceAuthorization JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceAuthorization)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceAuthorization(document.RootElement, options); } - internal static ResourceAuthorization DeserializeResourceAuthorization(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceAuthorization DeserializeResourceAuthorization(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string scope = default; string action = default; - IReadOnlyDictionary evidence = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary evidence = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("scope"u8)) + if (prop.NameEquals("scope"u8)) { - scope = property.Value.GetString(); + scope = prop.Value.GetString(); continue; } - if (property.NameEquals("action"u8)) + if (prop.NameEquals("action"u8)) { - action = property.Value.GetString(); + action = prop.Value.GetString(); continue; } - if (property.NameEquals("evidence"u8)) + if (prop.NameEquals("evidence"u8)) { Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } evidence = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceAuthorization(scope, action, evidence, serializedAdditionalRawData); + return new ResourceAuthorization(scope, action, evidence, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +160,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - ResourceAuthorization IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceAuthorization IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceAuthorization PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceAuthorization(document.RootElement, options); } default: @@ -154,22 +181,7 @@ ResourceAuthorization IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceAuthorization FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceAuthorization(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs index 07363e2f1dca..b19d1f8c8707 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The details of the authorization for the resource. public partial class ResourceAuthorization { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The evidence for the authorization. - /// is null. - internal ResourceAuthorization(IReadOnlyDictionary evidence) + internal ResourceAuthorization(IDictionary evidence) { - Argument.AssertNotNull(evidence, nameof(evidence)); - Evidence = evidence; } @@ -59,25 +27,22 @@ internal ResourceAuthorization(IReadOnlyDictionary evidence) /// The scope of the authorization. /// The action being requested. /// The evidence for the authorization. - /// Keeps track of any properties unknown to the library. - internal ResourceAuthorization(string scope, string action, IReadOnlyDictionary evidence, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceAuthorization(string scope, string action, IDictionary evidence, IDictionary additionalBinaryDataProperties) { Scope = scope; Action = action; Evidence = evidence; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceAuthorization() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The scope of the authorization. public string Scope { get; } + /// The action being requested. public string Action { get; } + /// The evidence for the authorization. - public IReadOnlyDictionary Evidence { get; } + public IDictionary Evidence { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs index ee33dcb880f1..b64fbc34e02b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled. [JsonConverter(typeof(ResourceDeleteCancelEventDataConverter))] - public partial class ResourceDeleteCancelEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceDeleteCancelEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceDeleteCancelEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceDeleteCancelEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceDeleteCancelEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceDeleteCancelEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceDeleteCancelEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceDeleteCancelEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceDeleteCancelEventData(document.RootElement, options); } - internal static ResourceDeleteCancelEventData DeserializeResourceDeleteCancelEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceDeleteCancelEventData DeserializeResourceDeleteCancelEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceDeleteCancelEventData DeserializeResourceDeleteCancelEve string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceDeleteCancelEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceDeleteCancelEventData DeserializeResourceDeleteCancelEve resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ResourceDeleteCancelEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceDeleteCancelEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceDeleteCancelEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceDeleteCancelEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceDeleteCancelEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceDeleteCancelEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceDeleteCancelEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceDeleteCancelEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceDeleteCancelEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceDeleteCancelEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceDeleteCancelEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceDeleteCancelEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs index 81a2e99a8282..f0316970bb5f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled. public partial class ResourceDeleteCancelEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceDeleteCancelEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceDeleteCancelEventData(JsonElement authorizationJson, JsonElemen /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceDeleteCancelEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceDeleteCancelEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceDeleteCancelEventData(string tenantId, string subscriptionId, s ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceDeleteCancelEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs index e65bc7256c54..a3bafbacadab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails. [JsonConverter(typeof(ResourceDeleteFailureEventDataConverter))] - public partial class ResourceDeleteFailureEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceDeleteFailureEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceDeleteFailureEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceDeleteFailureEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceDeleteFailureEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceDeleteFailureEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceDeleteFailureEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceDeleteFailureEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceDeleteFailureEventData(document.RootElement, options); } - internal static ResourceDeleteFailureEventData DeserializeResourceDeleteFailureEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceDeleteFailureEventData DeserializeResourceDeleteFailureEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceDeleteFailureEventData DeserializeResourceDeleteFailureE string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceDeleteFailureEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceDeleteFailureEventData DeserializeResourceDeleteFailureE resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - ResourceDeleteFailureEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceDeleteFailureEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceDeleteFailureEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceDeleteFailureEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceDeleteFailureEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceDeleteFailureEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceDeleteFailureEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceDeleteFailureEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceDeleteFailureEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceDeleteFailureEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceDeleteFailureEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceDeleteFailureEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs index d73fa0594426..6ef44cbc345a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails. public partial class ResourceDeleteFailureEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceDeleteFailureEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceDeleteFailureEventData(JsonElement authorizationJson, JsonEleme /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceDeleteFailureEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceDeleteFailureEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceDeleteFailureEventData(string tenantId, string subscriptionId, ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceDeleteFailureEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs index 056494b86c68..2cf27acbca19 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds. [JsonConverter(typeof(ResourceDeleteSuccessEventDataConverter))] - public partial class ResourceDeleteSuccessEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceDeleteSuccessEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceDeleteSuccessEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceDeleteSuccessEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceDeleteSuccessEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceDeleteSuccessEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceDeleteSuccessEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceDeleteSuccessEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceDeleteSuccessEventData(document.RootElement, options); } - internal static ResourceDeleteSuccessEventData DeserializeResourceDeleteSuccessEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceDeleteSuccessEventData DeserializeResourceDeleteSuccessEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceDeleteSuccessEventData DeserializeResourceDeleteSuccessE string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceDeleteSuccessEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceDeleteSuccessEventData DeserializeResourceDeleteSuccessE resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - ResourceDeleteSuccessEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceDeleteSuccessEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceDeleteSuccessEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceDeleteSuccessEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceDeleteSuccessEventData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceDeleteSuccessEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceDeleteSuccessEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceDeleteSuccessEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceDeleteSuccessEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceDeleteSuccessEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceDeleteSuccessEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceDeleteSuccessEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs index 74bb6f6eaecb..85fd76b73a4b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds. public partial class ResourceDeleteSuccessEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceDeleteSuccessEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceDeleteSuccessEventData(JsonElement authorizationJson, JsonEleme /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceDeleteSuccessEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceDeleteSuccessEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceDeleteSuccessEventData(string tenantId, string subscriptionId, ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceDeleteSuccessEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.Serialization.cs index 4be9d807041a..953d2af955ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ResourceHttpRequest : IUtf8JsonSerializable, IJsonModel + /// The details of the HTTP request. + public partial class ResourceHttpRequest : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceHttpRequest)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ClientRequestId)) { writer.WritePropertyName("clientRequestId"u8); @@ -54,15 +53,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -71,67 +70,73 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceHttpRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceHttpRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceHttpRequest JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceHttpRequest)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceHttpRequest(document.RootElement, options); } - internal static ResourceHttpRequest DeserializeResourceHttpRequest(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceHttpRequest DeserializeResourceHttpRequest(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string clientRequestId = default; string clientIpAddress = default; - string method = default; + string methodString = default; string url = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("clientIpAddress"u8)) + if (prop.NameEquals("clientIpAddress"u8)) { - clientIpAddress = property.Value.GetString(); + clientIpAddress = prop.Value.GetString(); continue; } - if (property.NameEquals("method"u8)) + if (prop.NameEquals("method"u8)) { - method = property.Value.GetString(); + methodString = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceHttpRequest(clientRequestId, clientIpAddress, method, url, serializedAdditionalRawData); + return new ResourceHttpRequest(clientRequestId, clientIpAddress, methodString, url, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -141,15 +146,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - ResourceHttpRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceHttpRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceHttpRequest PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceHttpRequest(document.RootElement, options); } default: @@ -157,22 +167,7 @@ ResourceHttpRequest IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceHttpRequest FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceHttpRequest(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.cs index 80f9b5b7ee32..051f582a132d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceHttpRequest.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The details of the HTTP request. public partial class ResourceHttpRequest { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ResourceHttpRequest() @@ -53,22 +24,24 @@ internal ResourceHttpRequest() /// Initializes a new instance of . /// The client request ID. /// The client IP address. - /// The request method. + /// /// The url used in the request. - /// Keeps track of any properties unknown to the library. - internal ResourceHttpRequest(string clientRequestId, string clientIpAddress, string methodString, string url, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceHttpRequest(string clientRequestId, string clientIpAddress, string methodString, string url, IDictionary additionalBinaryDataProperties) { ClientRequestId = clientRequestId; ClientIpAddress = clientIpAddress; MethodString = methodString; Url = url; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The client request ID. public string ClientRequestId { get; } + /// The client IP address. public string ClientIpAddress { get; } + /// The url used in the request. public string Url { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs index cfe5255b1a21..d131e78dd3ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event.Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event. [JsonConverter(typeof(ResourceNotificationsContainerServiceEventResourcesScheduledEventDataConverter))] - public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,70 +35,75 @@ void IJsonModel The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsContainerServiceEventResourcesScheduledEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ResourceNotificationsContainerServiceEventResourcesScheduledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsContainerServiceEventResourcesScheduledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ResourceNotificationsContainerServiceEventResourcesScheduledEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsContainerServiceEventResourcesScheduledEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement, options); } - internal static ResourceNotificationsContainerServiceEventResourcesScheduledEventData DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsContainerServiceEventResourcesScheduledEventData DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceUpdatedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; + ResourceNotificationsResourceUpdatedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; string apiVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } - if (property.NameEquals("apiVersion"u8)) + if (prop.NameEquals("apiVersion"u8)) { - apiVersion = property.Value.GetString(); + apiVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceInfo, operationalInfo, apiVersion, serializedAdditionalRawData); + return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +113,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsContainerServiceEventResourcesScheduledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ResourceNotificationsContainerServiceEventResourcesScheduledEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement, options); } default: @@ -119,35 +134,28 @@ ResourceNotificationsContainerServiceEventResourcesScheduledEventData IPersistab } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ResourceNotificationsContainerServiceEventResourcesScheduledEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsContainerServiceEventResourcesScheduledEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsContainerServiceEventResourcesScheduledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs index a5214a2e30d8..d9803c396bd6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs @@ -17,25 +17,16 @@ public partial class ResourceNotificationsContainerServiceEventResourcesSchedule /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// , or is null. internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); } /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary serializedAdditionalRawData) : base(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary additionalBinaryDataProperties) : base(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs index a2235771493c..eb3a865892cc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs @@ -10,15 +10,23 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated event. + /// [JsonConverter(typeof(ResourceNotificationsHealthResourcesAnnotatedEventDataConverter))] - public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsHealthResourcesAnnotatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,70 +38,75 @@ void IJsonModel.Write(Ut /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsHealthResourcesAnnotatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ResourceNotificationsHealthResourcesAnnotatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsHealthResourcesAnnotatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ResourceNotificationsHealthResourcesAnnotatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsHealthResourcesAnnotatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(document.RootElement, options); } - internal static ResourceNotificationsHealthResourcesAnnotatedEventData DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsHealthResourcesAnnotatedEventData DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceUpdatedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; + ResourceNotificationsResourceUpdatedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; string apiVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } - if (property.NameEquals("apiVersion"u8)) + if (prop.NameEquals("apiVersion"u8)) { - apiVersion = property.Value.GetString(); + apiVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsHealthResourcesAnnotatedEventData(resourceInfo, operationalInfo, apiVersion, serializedAdditionalRawData); + return new ResourceNotificationsHealthResourcesAnnotatedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +116,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsHealthResourcesAnnotatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ResourceNotificationsHealthResourcesAnnotatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(document.RootElement, options); } default: @@ -119,35 +137,28 @@ ResourceNotificationsHealthResourcesAnnotatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ResourceNotificationsHealthResourcesAnnotatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsHealthResourcesAnnotatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsHealthResourcesAnnotatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsHealthResourcesAnnotatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.cs index 514fa2729468..186461c4aab5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.cs @@ -20,25 +20,16 @@ public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Re /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// , or is null. internal ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); } /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary serializedAdditionalRawData) : base(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsHealthResourcesAnnotatedEventData() + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary additionalBinaryDataProperties) : base(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs index 833aeb668b7c..69054d9c5077 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs @@ -10,15 +10,24 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged + /// event. + /// [JsonConverter(typeof(ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventDataConverter))] - public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,70 +39,75 @@ void IJsonModel The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(document.RootElement, options); } - internal static ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceUpdatedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; + ResourceNotificationsResourceUpdatedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; string apiVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } - if (property.NameEquals("apiVersion"u8)) + if (prop.NameEquals("apiVersion"u8)) { - apiVersion = property.Value.GetString(); + apiVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(resourceInfo, operationalInfo, apiVersion, serializedAdditionalRawData); + return new ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +117,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(document.RootElement, options); } default: @@ -119,35 +138,28 @@ ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData IPersista } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs index 69c82e046f26..33832fe3affe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs @@ -21,25 +21,16 @@ public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChang /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// , or is null. internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); } /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary serializedAdditionalRawData) : base(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData() + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary additionalBinaryDataProperties) : base(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs index 8a5300904d30..b3076d32b6f6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ResourceNotificationsOperationalDetails : IUtf8JsonSerializable, IJsonModel + /// details of operational info. + public partial class ResourceNotificationsOperationalDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsOperationalDetails)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceEventTime)) { writer.WritePropertyName("resourceEventTime"u8); writer.WriteStringValue(ResourceEventTime.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +55,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceNotificationsOperationalDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsOperationalDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsOperationalDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsOperationalDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsOperationalDetails(document.RootElement, options); } - internal static ResourceNotificationsOperationalDetails DeserializeResourceNotificationsOperationalDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsOperationalDetails DeserializeResourceNotificationsOperationalDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DateTimeOffset? resourceEventTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceEventTime"u8)) + if (prop.NameEquals("resourceEventTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceEventTime = property.Value.GetDateTimeOffset("O"); + resourceEventTime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsOperationalDetails(resourceEventTime, serializedAdditionalRawData); + return new ResourceNotificationsOperationalDetails(resourceEventTime, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +117,20 @@ BinaryData IPersistableModel.Write(Mode } } - ResourceNotificationsOperationalDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsOperationalDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsOperationalDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsOperationalDetails(document.RootElement, options); } default: @@ -128,22 +138,7 @@ ResourceNotificationsOperationalDetails IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceNotificationsOperationalDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsOperationalDetails(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs index d9354209fe26..7c5e4dd3d43a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// details of operational info. public partial class ResourceNotificationsOperationalDetails { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal ResourceNotificationsOperationalDetails() @@ -52,11 +23,11 @@ internal ResourceNotificationsOperationalDetails() /// Initializes a new instance of . /// Date and Time when resource was updated. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime, IDictionary additionalBinaryDataProperties) { ResourceEventTime = resourceEventTime; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Date and Time when resource was updated. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs index 3aff136b5859..7150f944a12b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs @@ -13,10 +13,19 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ResourceNotificationsResourceDeletedDetails : IUtf8JsonSerializable, IJsonModel + /// + /// Describes the schema of the properties under resource info which are common + /// across all ARN system topic delete events + /// + public partial class ResourceNotificationsResourceDeletedDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceDeletedDetails() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,27 +37,26 @@ void IJsonModel.Write(Utf8JsonWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceDeletedDetails)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Resource); + writer.WriteObjectValue(Resource, options); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,61 +65,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceNotificationsResourceDeletedDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsResourceDeletedDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceDeletedDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceDeletedDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsResourceDeletedDetails(document.RootElement, options); } - internal static ResourceNotificationsResourceDeletedDetails DeserializeResourceNotificationsResourceDeletedDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsResourceDeletedDetails DeserializeResourceNotificationsResourceDeletedDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceIdentifier id = default; + ResourceIdentifier resource = default; string name = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + resource = ResourceIdentifier.DeserializeResourceIdentifier(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsResourceDeletedDetails(id, name, type, serializedAdditionalRawData); + return new ResourceNotificationsResourceDeletedDetails(resource, name, @type, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -121,15 +135,20 @@ BinaryData IPersistableModel.Write( } } - ResourceNotificationsResourceDeletedDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsResourceDeletedDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceDeletedDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsResourceDeletedDetails(document.RootElement, options); } default: @@ -137,22 +156,7 @@ ResourceNotificationsResourceDeletedDetails IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceNotificationsResourceDeletedDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsResourceDeletedDetails(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.cs index 1c3af5af7c98..e1ab702b5941 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.cs @@ -17,70 +17,31 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// public partial class ResourceNotificationsResourceDeletedDetails { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// id of the resource for which the event is being emitted. - /// name of the resource for which the event is being emitted. - /// the type of the resource for which the event is being emitted. - /// , or is null. - internal ResourceNotificationsResourceDeletedDetails(ResourceIdentifier resource, string name, string type) + /// Resource for which the event is being emitted. + /// + /// + internal ResourceNotificationsResourceDeletedDetails(ResourceIdentifier resource, string name, string @type) { - Argument.AssertNotNull(resource, nameof(resource)); - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(type, nameof(type)); - Resource = resource; Name = name; - Type = type; + Type = @type; } /// Initializes a new instance of . - /// id of the resource for which the event is being emitted. - /// name of the resource for which the event is being emitted. - /// the type of the resource for which the event is being emitted. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsResourceDeletedDetails(ResourceIdentifier resource, string name, string type, IDictionary serializedAdditionalRawData) + /// Resource for which the event is being emitted. + /// + /// + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsResourceDeletedDetails(ResourceIdentifier resource, string name, string @type, IDictionary additionalBinaryDataProperties) { Resource = resource; Name = name; - Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsResourceDeletedDetails() - { + Type = @type; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.Serialization.cs index 600e89027b5b..077361abef38 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.Serialization.cs @@ -10,15 +10,23 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// Describes the schema of the common properties across all ARN system topic + /// delete events + /// [JsonConverter(typeof(ResourceNotificationsResourceDeletedEventDataConverter))] - public partial class ResourceNotificationsResourceDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsResourceDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,25 +38,24 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceDeletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceInfo"u8); writer.WriteObjectValue(ResourceDetails, options); writer.WritePropertyName("operationalInfo"u8); writer.WriteObjectValue(OperationalDetails, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,55 +64,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceNotificationsResourceDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsResourceDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsResourceDeletedEventData(document.RootElement, options); } - internal static ResourceNotificationsResourceDeletedEventData DeserializeResourceNotificationsResourceDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsResourceDeletedEventData DeserializeResourceNotificationsResourceDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceDeletedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + ResourceNotificationsResourceDeletedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceDeletedDetails.DeserializeResourceNotificationsResourceDeletedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceDeletedDetails.DeserializeResourceNotificationsResourceDeletedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsResourceDeletedEventData(resourceInfo, operationalInfo, serializedAdditionalRawData); + return new ResourceNotificationsResourceDeletedEventData(resourceDetails, operationalDetails, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -115,15 +128,20 @@ BinaryData IPersistableModel.Writ } } - ResourceNotificationsResourceDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsResourceDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsResourceDeletedEventData(document.RootElement, options); } default: @@ -131,35 +149,28 @@ ResourceNotificationsResourceDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceNotificationsResourceDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsResourceDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsResourceDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsResourceDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsResourceDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsResourceDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsResourceDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.cs index 5dee76cd0d52..7c943b86e55f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedEventData.cs @@ -16,47 +16,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// public partial class ResourceNotificationsResourceDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// resourceInfo details for delete event. /// details about operational info. - /// or is null. internal ResourceNotificationsResourceDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); - ResourceDetails = resourceDetails; OperationalDetails = operationalDetails; } @@ -64,21 +31,17 @@ internal ResourceNotificationsResourceDeletedEventData(ResourceNotificationsReso /// Initializes a new instance of . /// resourceInfo details for delete event. /// details about operational info. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsResourceDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsResourceDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, IDictionary additionalBinaryDataProperties) { ResourceDetails = resourceDetails; OperationalDetails = operationalDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsResourceDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// resourceInfo details for delete event. public ResourceNotificationsResourceDeletedDetails ResourceDetails { get; } + /// details about operational info. public ResourceNotificationsOperationalDetails OperationalDetails { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.Serialization.cs index 801d68145ed8..4298e17d4aa6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.Serialization.cs @@ -10,15 +10,23 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.Resources.CreatedOrUpdated event. + /// [JsonConverter(typeof(ResourceNotificationsResourceManagementCreatedOrUpdatedEventDataConverter))] - public partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,70 +38,75 @@ void IJsonModel The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceManagementCreatedOrUpdatedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ResourceNotificationsResourceManagementCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsResourceManagementCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ResourceNotificationsResourceManagementCreatedOrUpdatedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceManagementCreatedOrUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(document.RootElement, options); } - internal static ResourceNotificationsResourceManagementCreatedOrUpdatedEventData DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsResourceManagementCreatedOrUpdatedEventData DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceUpdatedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; + ResourceNotificationsResourceUpdatedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; string apiVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } - if (property.NameEquals("apiVersion"u8)) + if (prop.NameEquals("apiVersion"u8)) { - apiVersion = property.Value.GetString(); + apiVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(resourceInfo, operationalInfo, apiVersion, serializedAdditionalRawData); + return new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +116,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsResourceManagementCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ResourceNotificationsResourceManagementCreatedOrUpdatedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(document.RootElement, options); } default: @@ -119,35 +137,28 @@ ResourceNotificationsResourceManagementCreatedOrUpdatedEventData IPersistableMod } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsResourceManagementCreatedOrUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsResourceManagementCreatedOrUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsResourceManagementCreatedOrUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.cs index d4621dbc6f13..d8c66bfbd795 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.cs @@ -20,25 +20,16 @@ public partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEven /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// , or is null. internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); } /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary serializedAdditionalRawData) : base(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData() + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary additionalBinaryDataProperties) : base(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.Serialization.cs index 8f6a68fc2d3d..e1d97fa5f913 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.Serialization.cs @@ -10,15 +10,23 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.ResourceNotifications.Resources.Deleted event. + /// [JsonConverter(typeof(ResourceNotificationsResourceManagementDeletedEventDataConverter))] - public partial class ResourceNotificationsResourceManagementDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsResourceManagementDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceManagementDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,64 +38,69 @@ void IJsonModel.Write(U /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceManagementDeletedEventData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ResourceNotificationsResourceManagementDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsResourceManagementDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ResourceNotificationsResourceManagementDeletedEventData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceManagementDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsResourceManagementDeletedEventData(document.RootElement, options); } - internal static ResourceNotificationsResourceManagementDeletedEventData DeserializeResourceNotificationsResourceManagementDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsResourceManagementDeletedEventData DeserializeResourceNotificationsResourceManagementDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceDeletedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + ResourceNotificationsResourceDeletedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceDeletedDetails.DeserializeResourceNotificationsResourceDeletedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceDeletedDetails.DeserializeResourceNotificationsResourceDeletedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsResourceManagementDeletedEventData(resourceInfo, operationalInfo, serializedAdditionalRawData); + return new ResourceNotificationsResourceManagementDeletedEventData(resourceDetails, operationalDetails, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -97,15 +110,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsResourceManagementDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ResourceNotificationsResourceManagementDeletedEventData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ResourceNotificationsResourceDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsResourceManagementDeletedEventData(document.RootElement, options); } default: @@ -113,35 +131,28 @@ ResourceNotificationsResourceManagementDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new ResourceNotificationsResourceManagementDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsResourceManagementDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsResourceManagementDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsResourceManagementDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsResourceManagementDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsResourceManagementDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsResourceManagementDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.cs index 78e118f95d49..7020f32dfea6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementDeletedEventData.cs @@ -19,23 +19,15 @@ public partial class ResourceNotificationsResourceManagementDeletedEventData : R /// Initializes a new instance of . /// resourceInfo details for delete event. /// details about operational info. - /// or is null. internal ResourceNotificationsResourceManagementDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails) : base(resourceDetails, operationalDetails) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); } /// Initializes a new instance of . /// resourceInfo details for delete event. /// details about operational info. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsResourceManagementDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, IDictionary serializedAdditionalRawData) : base(resourceDetails, operationalDetails, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsResourceManagementDeletedEventData() + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsResourceManagementDeletedEventData(ResourceNotificationsResourceDeletedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, IDictionary additionalBinaryDataProperties) : base(resourceDetails, operationalDetails, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs index 42cc8154c18b..0cd4e354de96 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs @@ -9,14 +9,22 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ResourceNotificationsResourceUpdatedDetails : IUtf8JsonSerializable, IJsonModel + /// + /// Describes the schema of the properties under resource info which are common + /// across all ARN system topic events + /// + public partial class ResourceNotificationsResourceUpdatedDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceUpdatedDetails() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +36,11 @@ void IJsonModel.Write(Utf8JsonWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceUpdatedDetails)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("name"u8); @@ -52,6 +59,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in ResourceTags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -72,15 +84,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -89,86 +101,97 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceNotificationsResourceUpdatedDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsResourceUpdatedDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceUpdatedDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceUpdatedDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsResourceUpdatedDetails(document.RootElement, options); } - internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceNotificationsResourceUpdatedDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceNotificationsResourceUpdatedDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; string name = default; - string type = default; + string resourceType = default; string location = default; - IReadOnlyDictionary tags = default; + IReadOnlyDictionary resourceTags = default; IReadOnlyDictionary properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + resourceType = prop.Value.GetString(); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = property.Value.GetString(); + location = prop.Value.GetString(); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } - tags = dictionary; + resourceTags = dictionary; continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - if (property0.Value.ValueKind == JsonValueKind.Null) + if (prop0.Value.ValueKind == JsonValueKind.Null) { - dictionary.Add(property0.Name, null); + dictionary.Add(prop0.Name, null); } else { - dictionary.Add(property0.Name, property0.Value.GetObject()); + dictionary.Add(prop0.Name, prop0.Value.GetObject()); } } properties = dictionary; @@ -176,24 +199,26 @@ internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceN } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceNotificationsResourceUpdatedDetails( id, name, - type, + resourceType, location, - tags ?? new ChangeTrackingDictionary(), + resourceTags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -203,15 +228,20 @@ BinaryData IPersistableModel.Write( } } - ResourceNotificationsResourceUpdatedDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsResourceUpdatedDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceUpdatedDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsResourceUpdatedDetails(document.RootElement, options); } default: @@ -219,22 +249,7 @@ ResourceNotificationsResourceUpdatedDetails IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceNotificationsResourceUpdatedDetails FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsResourceUpdatedDetails(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.cs index 27f6ce744270..4f40778b83f3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.cs @@ -16,49 +16,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// public partial class ResourceNotificationsResourceUpdatedDetails { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// id of the resource for which the event is being emitted. /// name of the resource for which the event is being emitted. /// the type of the resource for which the event is being emitted. - /// , or is null. internal ResourceNotificationsResourceUpdatedDetails(string id, string name, string resourceType) { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(resourceType, nameof(resourceType)); - Id = id; Name = name; ResourceType = resourceType; @@ -72,9 +38,9 @@ internal ResourceNotificationsResourceUpdatedDetails(string id, string name, str /// the type of the resource for which the event is being emitted. /// the location of the resource for which the event is being emitted. /// the tags on the resource for which the event is being emitted. - /// properties in the payload of the resource for which the event is being emitted. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsResourceUpdatedDetails(string id, string name, string resourceType, string location, IReadOnlyDictionary resourceTags, IReadOnlyDictionary properties, IDictionary serializedAdditionalRawData) + /// The properties of the resource for which the event is being emitted. + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsResourceUpdatedDetails(string id, string name, string resourceType, string location, IReadOnlyDictionary resourceTags, IReadOnlyDictionary properties, IDictionary additionalBinaryDataProperties) { Id = id; Name = name; @@ -82,12 +48,7 @@ internal ResourceNotificationsResourceUpdatedDetails(string id, string name, str Location = location; ResourceTags = resourceTags; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsResourceUpdatedDetails() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.Serialization.cs index 312f17dc84dc..8c8b1a134af3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Describes the schema of the common properties across all ARN system topic events. [JsonConverter(typeof(ResourceNotificationsResourceUpdatedEventDataConverter))] - public partial class ResourceNotificationsResourceUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceNotificationsResourceUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceUpdatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,27 +35,26 @@ void IJsonModel.Write(Utf8JsonWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceUpdatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceInfo"u8); writer.WriteObjectValue(ResourceDetails, options); writer.WritePropertyName("operationalInfo"u8); writer.WriteObjectValue(OperationalDetails, options); writer.WritePropertyName("apiVersion"u8); writer.WriteStringValue(ApiVersion); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -59,61 +63,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceNotificationsResourceUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceNotificationsResourceUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceNotificationsResourceUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceNotificationsResourceUpdatedEventData(document.RootElement, options); } - internal static ResourceNotificationsResourceUpdatedEventData DeserializeResourceNotificationsResourceUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceNotificationsResourceUpdatedEventData DeserializeResourceNotificationsResourceUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ResourceNotificationsResourceUpdatedDetails resourceInfo = default; - ResourceNotificationsOperationalDetails operationalInfo = default; + ResourceNotificationsResourceUpdatedDetails resourceDetails = default; + ResourceNotificationsOperationalDetails operationalDetails = default; string apiVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceInfo"u8)) + if (prop.NameEquals("resourceInfo"u8)) { - resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value, options); + resourceDetails = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(prop.Value, options); continue; } - if (property.NameEquals("operationalInfo"u8)) + if (prop.NameEquals("operationalInfo"u8)) { - operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + operationalDetails = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(prop.Value, options); continue; } - if (property.NameEquals("apiVersion"u8)) + if (prop.NameEquals("apiVersion"u8)) { - apiVersion = property.Value.GetString(); + apiVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceNotificationsResourceUpdatedEventData(resourceInfo, operationalInfo, apiVersion, serializedAdditionalRawData); + return new ResourceNotificationsResourceUpdatedEventData(resourceDetails, operationalDetails, apiVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +133,20 @@ BinaryData IPersistableModel.Writ } } - ResourceNotificationsResourceUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceNotificationsResourceUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceNotificationsResourceUpdatedEventData(document.RootElement, options); } default: @@ -139,35 +154,28 @@ ResourceNotificationsResourceUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceNotificationsResourceUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceNotificationsResourceUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceNotificationsResourceUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceNotificationsResourceUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceNotificationsResourceUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceNotificationsResourceUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsResourceUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.cs index 72653d401f46..c933c430e161 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.cs @@ -13,49 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Describes the schema of the common properties across all ARN system topic events. public partial class ResourceNotificationsResourceUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// , or is null. internal ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) { - Argument.AssertNotNull(resourceDetails, nameof(resourceDetails)); - Argument.AssertNotNull(operationalDetails, nameof(operationalDetails)); - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - ResourceDetails = resourceDetails; OperationalDetails = operationalDetails; ApiVersion = apiVersion; @@ -65,24 +31,21 @@ internal ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsReso /// resourceInfo details for update event. /// details about operational info. /// api version of the resource properties bag. - /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion, IDictionary additionalBinaryDataProperties) { ResourceDetails = resourceDetails; OperationalDetails = operationalDetails; ApiVersion = apiVersion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsResourceUpdatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// resourceInfo details for update event. public ResourceNotificationsResourceUpdatedDetails ResourceDetails { get; } + /// details about operational info. public ResourceNotificationsOperationalDetails OperationalDetails { get; } + /// api version of the resource properties bag. public string ApiVersion { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs index 458a80f539be..13a847fce681 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled. [JsonConverter(typeof(ResourceWriteCancelEventDataConverter))] - public partial class ResourceWriteCancelEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceWriteCancelEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceWriteCancelEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceWriteCancelEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceWriteCancelEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceWriteCancelEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceWriteCancelEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceWriteCancelEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceWriteCancelEventData(document.RootElement, options); } - internal static ResourceWriteCancelEventData DeserializeResourceWriteCancelEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceWriteCancelEventData DeserializeResourceWriteCancelEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceWriteCancelEventData DeserializeResourceWriteCancelEvent string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceWriteCancelEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceWriteCancelEventData DeserializeResourceWriteCancelEvent resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - ResourceWriteCancelEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceWriteCancelEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceWriteCancelEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceWriteCancelEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceWriteCancelEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceWriteCancelEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceWriteCancelEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceWriteCancelEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceWriteCancelEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceWriteCancelEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceWriteCancelEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceWriteCancelEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs index 2e44e0b9dccc..33134f30847e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled. public partial class ResourceWriteCancelEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceWriteCancelEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceWriteCancelEventData(JsonElement authorizationJson, JsonElement /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceWriteCancelEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceWriteCancelEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceWriteCancelEventData(string tenantId, string subscriptionId, st ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceWriteCancelEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs index 6fad4ced60ea..8b910f7dbd4d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails. [JsonConverter(typeof(ResourceWriteFailureEventDataConverter))] - public partial class ResourceWriteFailureEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceWriteFailureEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceWriteFailureEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceWriteFailureEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceWriteFailureEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceWriteFailureEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceWriteFailureEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceWriteFailureEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceWriteFailureEventData(document.RootElement, options); } - internal static ResourceWriteFailureEventData DeserializeResourceWriteFailureEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceWriteFailureEventData DeserializeResourceWriteFailureEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceWriteFailureEventData DeserializeResourceWriteFailureEve string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceWriteFailureEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceWriteFailureEventData DeserializeResourceWriteFailureEve resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ResourceWriteFailureEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceWriteFailureEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceWriteFailureEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceWriteFailureEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceWriteFailureEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceWriteFailureEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceWriteFailureEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceWriteFailureEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceWriteFailureEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceWriteFailureEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceWriteFailureEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceWriteFailureEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs index bebb34b9476f..a22d97cd1209 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails. public partial class ResourceWriteFailureEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceWriteFailureEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceWriteFailureEventData(JsonElement authorizationJson, JsonElemen /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceWriteFailureEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceWriteFailureEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceWriteFailureEventData(string tenantId, string subscriptionId, s ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceWriteFailureEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs index 05048f64866d..361a3039b806 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds. [JsonConverter(typeof(ResourceWriteSuccessEventDataConverter))] - public partial class ResourceWriteSuccessEventData : IUtf8JsonSerializable, IJsonModel + public partial class ResourceWriteSuccessEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ResourceWriteSuccessEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceWriteSuccessEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -82,15 +86,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("httpRequest"u8); HttpRequestJson.WriteTo(writer); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -99,22 +103,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceWriteSuccessEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ResourceWriteSuccessEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceWriteSuccessEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResourceWriteSuccessEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResourceWriteSuccessEventData(document.RootElement, options); } - internal static ResourceWriteSuccessEventData DeserializeResourceWriteSuccessEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ResourceWriteSuccessEventData DeserializeResourceWriteSuccessEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,75 +135,73 @@ internal static ResourceWriteSuccessEventData DeserializeResourceWriteSuccessEve string resourceUri = default; string operationName = default; string status = default; - JsonElement authorization = default; - JsonElement claims = default; + JsonElement authorizationJson = default; + JsonElement claimsJson = default; string correlationId = default; - JsonElement httpRequest = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + JsonElement httpRequestJson = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tenantId"u8)) + if (prop.NameEquals("tenantId"u8)) { - tenantId = property.Value.GetString(); + tenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionId"u8)) + if (prop.NameEquals("subscriptionId"u8)) { - subscriptionId = property.Value.GetString(); + subscriptionId = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceGroup"u8)) + if (prop.NameEquals("resourceGroup"u8)) { - resourceGroup = property.Value.GetString(); + resourceGroup = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceProvider"u8)) + if (prop.NameEquals("resourceProvider"u8)) { - resourceProvider = property.Value.GetString(); + resourceProvider = prop.Value.GetString(); continue; } - if (property.NameEquals("resourceUri"u8)) + if (prop.NameEquals("resourceUri"u8)) { - resourceUri = property.Value.GetString(); + resourceUri = prop.Value.GetString(); continue; } - if (property.NameEquals("operationName"u8)) + if (prop.NameEquals("operationName"u8)) { - operationName = property.Value.GetString(); + operationName = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("authorization"u8)) + if (prop.NameEquals("authorization"u8)) { - authorization = property.Value.Clone(); + authorizationJson = prop.Value.Clone(); continue; } - if (property.NameEquals("claims"u8)) + if (prop.NameEquals("claims"u8)) { - claims = property.Value.Clone(); + claimsJson = prop.Value.Clone(); continue; } - if (property.NameEquals("correlationId"u8)) + if (prop.NameEquals("correlationId"u8)) { - correlationId = property.Value.GetString(); + correlationId = prop.Value.GetString(); continue; } - if (property.NameEquals("httpRequest"u8)) + if (prop.NameEquals("httpRequest"u8)) { - httpRequest = property.Value.Clone(); + httpRequestJson = prop.Value.Clone(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResourceWriteSuccessEventData( tenantId, subscriptionId, @@ -203,17 +210,20 @@ internal static ResourceWriteSuccessEventData DeserializeResourceWriteSuccessEve resourceUri, operationName, status, - authorization, - claims, + authorizationJson, + claimsJson, correlationId, - httpRequest, - serializedAdditionalRawData); + httpRequestJson, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -223,15 +233,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - ResourceWriteSuccessEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ResourceWriteSuccessEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceWriteSuccessEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeResourceWriteSuccessEventData(document.RootElement, options); } default: @@ -239,35 +254,28 @@ ResourceWriteSuccessEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ResourceWriteSuccessEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceWriteSuccessEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ResourceWriteSuccessEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ResourceWriteSuccessEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ResourceWriteSuccessEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceWriteSuccessEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceWriteSuccessEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs index 8f08b55c07b7..066ec9650d2b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs @@ -14,42 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds. public partial class ResourceWriteSuccessEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The requested authorization for the operation. - /// The properties of the claims. - /// The details of the operation. + /// + /// + /// internal ResourceWriteSuccessEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; @@ -65,12 +36,12 @@ internal ResourceWriteSuccessEventData(JsonElement authorizationJson, JsonElemen /// The URI of the resource in the operation. /// The operation that was performed. /// The status of the operation. - /// The requested authorization for the operation. - /// The properties of the claims. + /// + /// /// An operation ID used for troubleshooting. - /// The details of the operation. - /// Keeps track of any properties unknown to the library. - internal ResourceWriteSuccessEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal ResourceWriteSuccessEventData(string tenantId, string subscriptionId, string resourceGroup, string resourceProvider, string resourceUri, string operationName, string status, JsonElement authorizationJson, JsonElement claimsJson, string correlationId, JsonElement httpRequestJson, IDictionary additionalBinaryDataProperties) { TenantId = tenantId; SubscriptionId = subscriptionId; @@ -83,28 +54,30 @@ internal ResourceWriteSuccessEventData(string tenantId, string subscriptionId, s ClaimsJson = claimsJson; CorrelationId = correlationId; HttpRequestJson = httpRequestJson; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ResourceWriteSuccessEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The tenant ID of the resource. public string TenantId { get; } + /// The subscription ID of the resource. public string SubscriptionId { get; } + /// The resource group of the resource. public string ResourceGroup { get; } + /// The resource provider performing the operation. public string ResourceProvider { get; } + /// The URI of the resource in the operation. public string ResourceUri { get; } + /// The operation that was performed. public string OperationName { get; } + /// The status of the operation. public string Status { get; } + /// An operation ID used for troubleshooting. public string CorrelationId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs index 7eeb08b99bf6..f079df5e318b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event. [JsonConverter(typeof(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventDataConverter))] - public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData : IUtf8JsonSerializable, IJsonModel + public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,54 +35,53 @@ void IJsonModel /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("namespaceName"u8); writer.WriteStringValue(NamespaceName); writer.WritePropertyName("requestUri"u8); writer.WriteStringValue(RequestUri); writer.WritePropertyName("entityType"u8); writer.WriteStringValue(EntityType); - if (QueueName != null) + if (Optional.IsDefined(QueueName)) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } else { - writer.WriteNull("queueName"); + writer.WriteNull("queueName"u8); } - if (TopicName != null) + if (Optional.IsDefined(TopicName)) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } else { - writer.WriteNull("topicName"); + writer.WriteNull("topicName"u8); } - if (SubscriptionName != null) + if (Optional.IsDefined(SubscriptionName)) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } else { - writer.WriteNull("subscriptionName"); + writer.WriteNull("subscriptionName"u8); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +90,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(document.RootElement, options); } - internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -112,61 +121,59 @@ internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData string queueName = default; string topicName = default; string subscriptionName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - namespaceName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } - if (property.NameEquals("requestUri"u8)) + if (prop.NameEquals("requestUri"u8)) { - requestUri = property.Value.GetString(); + requestUri = prop.Value.GetString(); continue; } - if (property.NameEquals("entityType"u8)) + if (prop.NameEquals("entityType"u8)) { - entityType = property.Value.GetString(); + entityType = prop.Value.GetString(); continue; } - if (property.NameEquals("queueName"u8)) + if (prop.NameEquals("queueName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { queueName = null; continue; } - queueName = property.Value.GetString(); + queueName = prop.Value.GetString(); continue; } - if (property.NameEquals("topicName"u8)) + if (prop.NameEquals("topicName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { topicName = null; continue; } - topicName = property.Value.GetString(); + topicName = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionName"u8)) + if (prop.NameEquals("subscriptionName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { subscriptionName = null; continue; } - subscriptionName = property.Value.GetString(); + subscriptionName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData( namespaceName, requestUri, @@ -174,13 +181,16 @@ internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData queueName, topicName, subscriptionName, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -190,15 +200,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(document.RootElement, options); } default: @@ -206,35 +221,28 @@ ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData IPersistableMode } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs index f22d23f2fda6..21df1ff7bb5c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event. public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The namespace name of the Microsoft.ServiceBus resource. @@ -52,13 +23,8 @@ public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEvent /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// , or is null. internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName) { - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(requestUri, nameof(requestUri)); - Argument.AssertNotNull(entityType, nameof(entityType)); - NamespaceName = namespaceName; RequestUri = requestUri; EntityType = entityType; @@ -74,8 +40,8 @@ internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// Keeps track of any properties unknown to the library. - internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary additionalBinaryDataProperties) { NamespaceName = namespaceName; RequestUri = requestUri; @@ -83,24 +49,24 @@ internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string QueueName = queueName; TopicName = topicName; SubscriptionName = subscriptionName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } + /// The endpoint of the Microsoft.ServiceBus resource. public string RequestUri { get; } + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. public string EntityType { get; } + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. public string QueueName { get; } + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. public string TopicName { get; } + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. public string SubscriptionName { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs index 76b437b1fc8e..fc502ef34ef8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. [JsonConverter(typeof(ServiceBusActiveMessagesAvailableWithNoListenersEventDataConverter))] - public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData : IUtf8JsonSerializable, IJsonModel + public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,54 +35,53 @@ void IJsonModel.Write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusActiveMessagesAvailableWithNoListenersEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("namespaceName"u8); writer.WriteStringValue(NamespaceName); writer.WritePropertyName("requestUri"u8); writer.WriteStringValue(RequestUri); writer.WritePropertyName("entityType"u8); writer.WriteStringValue(EntityType); - if (QueueName != null) + if (Optional.IsDefined(QueueName)) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } else { - writer.WriteNull("queueName"); + writer.WriteNull("queueName"u8); } - if (TopicName != null) + if (Optional.IsDefined(TopicName)) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } else { - writer.WriteNull("topicName"); + writer.WriteNull("topicName"u8); } - if (SubscriptionName != null) + if (Optional.IsDefined(SubscriptionName)) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } else { - writer.WriteNull("subscriptionName"); + writer.WriteNull("subscriptionName"u8); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +90,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ServiceBusActiveMessagesAvailableWithNoListenersEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ServiceBusActiveMessagesAvailableWithNoListenersEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ServiceBusActiveMessagesAvailableWithNoListenersEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusActiveMessagesAvailableWithNoListenersEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(document.RootElement, options); } - internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -112,61 +121,59 @@ internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData Deseri string queueName = default; string topicName = default; string subscriptionName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - namespaceName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } - if (property.NameEquals("requestUri"u8)) + if (prop.NameEquals("requestUri"u8)) { - requestUri = property.Value.GetString(); + requestUri = prop.Value.GetString(); continue; } - if (property.NameEquals("entityType"u8)) + if (prop.NameEquals("entityType"u8)) { - entityType = property.Value.GetString(); + entityType = prop.Value.GetString(); continue; } - if (property.NameEquals("queueName"u8)) + if (prop.NameEquals("queueName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { queueName = null; continue; } - queueName = property.Value.GetString(); + queueName = prop.Value.GetString(); continue; } - if (property.NameEquals("topicName"u8)) + if (prop.NameEquals("topicName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { topicName = null; continue; } - topicName = property.Value.GetString(); + topicName = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionName"u8)) + if (prop.NameEquals("subscriptionName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { subscriptionName = null; continue; } - subscriptionName = property.Value.GetString(); + subscriptionName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ServiceBusActiveMessagesAvailableWithNoListenersEventData( namespaceName, requestUri, @@ -174,13 +181,16 @@ internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData Deseri queueName, topicName, subscriptionName, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -190,15 +200,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ServiceBusActiveMessagesAvailableWithNoListenersEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ServiceBusActiveMessagesAvailableWithNoListenersEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(document.RootElement, options); } default: @@ -206,35 +221,28 @@ ServiceBusActiveMessagesAvailableWithNoListenersEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ServiceBusActiveMessagesAvailableWithNoListenersEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ServiceBusActiveMessagesAvailableWithNoListenersEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ServiceBusActiveMessagesAvailableWithNoListenersEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.cs index a13c94aa72e8..80f352d84f6f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The namespace name of the Microsoft.ServiceBus resource. @@ -52,13 +23,8 @@ public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// , or is null. internal ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName) { - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(requestUri, nameof(requestUri)); - Argument.AssertNotNull(entityType, nameof(entityType)); - NamespaceName = namespaceName; RequestUri = requestUri; EntityType = entityType; @@ -74,8 +40,8 @@ internal ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namesp /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// Keeps track of any properties unknown to the library. - internal ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary additionalBinaryDataProperties) { NamespaceName = namespaceName; RequestUri = requestUri; @@ -83,24 +49,24 @@ internal ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namesp QueueName = queueName; TopicName = topicName; SubscriptionName = subscriptionName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } + /// The endpoint of the Microsoft.ServiceBus resource. public string RequestUri { get; } + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. public string EntityType { get; } + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. public string QueueName { get; } + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. public string TopicName { get; } + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. public string SubscriptionName { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs index dd52ed7d4a6b..75adfe78363a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event. [JsonConverter(typeof(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDataConverter))] - public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData : IUtf8JsonSerializable, IJsonModel + public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,54 +35,53 @@ void IJsonModel The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("namespaceName"u8); writer.WriteStringValue(NamespaceName); writer.WritePropertyName("requestUri"u8); writer.WriteStringValue(RequestUri); writer.WritePropertyName("entityType"u8); writer.WriteStringValue(EntityType); - if (QueueName != null) + if (Optional.IsDefined(QueueName)) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } else { - writer.WriteNull("queueName"); + writer.WriteNull("queueName"u8); } - if (TopicName != null) + if (Optional.IsDefined(TopicName)) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } else { - writer.WriteNull("topicName"); + writer.WriteNull("topicName"u8); } - if (SubscriptionName != null) + if (Optional.IsDefined(SubscriptionName)) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } else { - writer.WriteNull("subscriptionName"); + writer.WriteNull("subscriptionName"u8); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +90,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(document.RootElement, options); } - internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -112,61 +121,59 @@ internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventD string queueName = default; string topicName = default; string subscriptionName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - namespaceName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } - if (property.NameEquals("requestUri"u8)) + if (prop.NameEquals("requestUri"u8)) { - requestUri = property.Value.GetString(); + requestUri = prop.Value.GetString(); continue; } - if (property.NameEquals("entityType"u8)) + if (prop.NameEquals("entityType"u8)) { - entityType = property.Value.GetString(); + entityType = prop.Value.GetString(); continue; } - if (property.NameEquals("queueName"u8)) + if (prop.NameEquals("queueName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { queueName = null; continue; } - queueName = property.Value.GetString(); + queueName = prop.Value.GetString(); continue; } - if (property.NameEquals("topicName"u8)) + if (prop.NameEquals("topicName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { topicName = null; continue; } - topicName = property.Value.GetString(); + topicName = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionName"u8)) + if (prop.NameEquals("subscriptionName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { subscriptionName = null; continue; } - subscriptionName = property.Value.GetString(); + subscriptionName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData( namespaceName, requestUri, @@ -174,13 +181,16 @@ internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventD queueName, topicName, subscriptionName, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -190,15 +200,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(document.RootElement, options); } default: @@ -206,35 +221,28 @@ ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData IPersistable } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs index 85e82fe95556..e845ef29b65e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event. public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The namespace name of the Microsoft.ServiceBus resource. @@ -52,13 +23,8 @@ public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsE /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// , or is null. internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName) { - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(requestUri, nameof(requestUri)); - Argument.AssertNotNull(entityType, nameof(entityType)); - NamespaceName = namespaceName; RequestUri = requestUri; EntityType = entityType; @@ -74,8 +40,8 @@ internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(str /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// Keeps track of any properties unknown to the library. - internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary additionalBinaryDataProperties) { NamespaceName = namespaceName; RequestUri = requestUri; @@ -83,24 +49,24 @@ internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(str QueueName = queueName; TopicName = topicName; SubscriptionName = subscriptionName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } + /// The endpoint of the Microsoft.ServiceBus resource. public string RequestUri { get; } + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. public string EntityType { get; } + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. public string QueueName { get; } + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. public string TopicName { get; } + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. public string SubscriptionName { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs index b7aed93d1efa..0bdff8d11765 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event. [JsonConverter(typeof(ServiceBusDeadletterMessagesAvailableWithNoListenersEventDataConverter))] - public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData : IUtf8JsonSerializable, IJsonModel + public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,54 +35,53 @@ void IJsonModel.W /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("namespaceName"u8); writer.WriteStringValue(NamespaceName); writer.WritePropertyName("requestUri"u8); writer.WriteStringValue(RequestUri); writer.WritePropertyName("entityType"u8); writer.WriteStringValue(EntityType); - if (QueueName != null) + if (Optional.IsDefined(QueueName)) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } else { - writer.WriteNull("queueName"); + writer.WriteNull("queueName"u8); } - if (TopicName != null) + if (Optional.IsDefined(TopicName)) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } else { - writer.WriteNull("topicName"); + writer.WriteNull("topicName"u8); } - if (SubscriptionName != null) + if (Optional.IsDefined(SubscriptionName)) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } else { - writer.WriteNull("subscriptionName"); + writer.WriteNull("subscriptionName"u8); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +90,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ServiceBusDeadletterMessagesAvailableWithNoListenersEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ServiceBusDeadletterMessagesAvailableWithNoListenersEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ServiceBusDeadletterMessagesAvailableWithNoListenersEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(document.RootElement, options); } - internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -112,61 +121,59 @@ internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData De string queueName = default; string topicName = default; string subscriptionName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("namespaceName"u8)) + if (prop.NameEquals("namespaceName"u8)) { - namespaceName = property.Value.GetString(); + namespaceName = prop.Value.GetString(); continue; } - if (property.NameEquals("requestUri"u8)) + if (prop.NameEquals("requestUri"u8)) { - requestUri = property.Value.GetString(); + requestUri = prop.Value.GetString(); continue; } - if (property.NameEquals("entityType"u8)) + if (prop.NameEquals("entityType"u8)) { - entityType = property.Value.GetString(); + entityType = prop.Value.GetString(); continue; } - if (property.NameEquals("queueName"u8)) + if (prop.NameEquals("queueName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { queueName = null; continue; } - queueName = property.Value.GetString(); + queueName = prop.Value.GetString(); continue; } - if (property.NameEquals("topicName"u8)) + if (prop.NameEquals("topicName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { topicName = null; continue; } - topicName = property.Value.GetString(); + topicName = prop.Value.GetString(); continue; } - if (property.NameEquals("subscriptionName"u8)) + if (prop.NameEquals("subscriptionName"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { subscriptionName = null; continue; } - subscriptionName = property.Value.GetString(); + subscriptionName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ServiceBusDeadletterMessagesAvailableWithNoListenersEventData( namespaceName, requestUri, @@ -174,13 +181,16 @@ internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData De queueName, topicName, subscriptionName, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -190,15 +200,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ServiceBusDeadletterMessagesAvailableWithNoListenersEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ServiceBusDeadletterMessagesAvailableWithNoListenersEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(document.RootElement, options); } default: @@ -206,35 +221,28 @@ ServiceBusDeadletterMessagesAvailableWithNoListenersEventData IPersistableModel< } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, ServiceBusDeadletterMessagesAvailableWithNoListenersEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override ServiceBusDeadletterMessagesAvailableWithNoListenersEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.cs index 530fc9265aee..1ef73a3fa47c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event. public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The namespace name of the Microsoft.ServiceBus resource. @@ -52,13 +23,8 @@ public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventDa /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// , or is null. internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName) { - Argument.AssertNotNull(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(requestUri, nameof(requestUri)); - Argument.AssertNotNull(entityType, nameof(entityType)); - NamespaceName = namespaceName; RequestUri = requestUri; EntityType = entityType; @@ -74,8 +40,8 @@ internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string na /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. - /// Keeps track of any properties unknown to the library. - internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName, IDictionary additionalBinaryDataProperties) { NamespaceName = namespaceName; RequestUri = requestUri; @@ -83,24 +49,24 @@ internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string na QueueName = queueName; TopicName = topicName; SubscriptionName = subscriptionName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } + /// The endpoint of the Microsoft.ServiceBus resource. public string RequestUri { get; } + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. public string EntityType { get; } + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. public string QueueName { get; } + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. public string TopicName { get; } + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. public string SubscriptionName { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs index 518377b935a1..2da8d8f41cc6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event. [JsonConverter(typeof(SignalRServiceClientConnectionConnectedEventDataConverter))] - public partial class SignalRServiceClientConnectionConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class SignalRServiceClientConnectionConnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SignalRServiceClientConnectionConnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8Json /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SignalRServiceClientConnectionConnectedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -50,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("userId"u8); writer.WriteStringValue(UserId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,22 +71,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SignalRServiceClientConnectionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SignalRServiceClientConnectionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SignalRServiceClientConnectionConnectedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SignalRServiceClientConnectionConnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSignalRServiceClientConnectionConnectedEventData(document.RootElement, options); } - internal static SignalRServiceClientConnectionConnectedEventData DeserializeSignalRServiceClientConnectionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SignalRServiceClientConnectionConnectedEventData DeserializeSignalRServiceClientConnectionConnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,47 +100,48 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign string hubName = default; string connectionId = default; string userId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("connectionId"u8)) + if (prop.NameEquals("connectionId"u8)) { - connectionId = property.Value.GetString(); + connectionId = prop.Value.GetString(); continue; } - if (property.NameEquals("userId"u8)) + if (prop.NameEquals("userId"u8)) { - userId = property.Value.GetString(); + userId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, serializedAdditionalRawData); + return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -141,15 +151,20 @@ BinaryData IPersistableModel.W } } - SignalRServiceClientConnectionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + SignalRServiceClientConnectionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SignalRServiceClientConnectionConnectedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeSignalRServiceClientConnectionConnectedEventData(document.RootElement, options); } default: @@ -157,35 +172,28 @@ SignalRServiceClientConnectionConnectedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static SignalRServiceClientConnectionConnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSignalRServiceClientConnectionConnectedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class SignalRServiceClientConnectionConnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, SignalRServiceClientConnectionConnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override SignalRServiceClientConnectionConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeSignalRServiceClientConnectionConnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSignalRServiceClientConnectionConnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs index 71d0f66cf94c..24b659cca944 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event. public partial class SignalRServiceClientConnectionConnectedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The hub of connected client connection. /// The connection Id of connected client connection. - /// or is null. internal SignalRServiceClientConnectionConnectedEventData(string hubName, string connectionId) { - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(connectionId, nameof(connectionId)); - HubName = hubName; ConnectionId = connectionId; } @@ -63,27 +30,25 @@ internal SignalRServiceClientConnectionConnectedEventData(string hubName, string /// The hub of connected client connection. /// The connection Id of connected client connection. /// The user Id of connected client connection. - /// Keeps track of any properties unknown to the library. - internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; HubName = hubName; ConnectionId = connectionId; UserId = userId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SignalRServiceClientConnectionConnectedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The hub of connected client connection. public string HubName { get; } + /// The connection Id of connected client connection. public string ConnectionId { get; } + /// The user Id of connected client connection. public string UserId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs index 4446c201ad21..3375bbbd1a8d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event. [JsonConverter(typeof(SignalRServiceClientConnectionDisconnectedEventDataConverter))] - public partial class SignalRServiceClientConnectionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class SignalRServiceClientConnectionDisconnectedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SignalRServiceClientConnectionDisconnectedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8J /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SignalRServiceClientConnectionDisconnectedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Timestamp)) { writer.WritePropertyName("timestamp"u8); @@ -55,15 +59,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("errorMessage"u8); writer.WriteStringValue(ErrorMessage); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -72,22 +76,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SignalRServiceClientConnectionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SignalRServiceClientConnectionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SignalRServiceClientConnectionDisconnectedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SignalRServiceClientConnectionDisconnectedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSignalRServiceClientConnectionDisconnectedEventData(document.RootElement, options); } - internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeSignalRServiceClientConnectionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeSignalRServiceClientConnectionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -97,58 +106,59 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS string connectionId = default; string userId = default; string errorMessage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("timestamp"u8)) + if (prop.NameEquals("timestamp"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - timestamp = property.Value.GetDateTimeOffset("O"); + timestamp = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("hubName"u8)) + if (prop.NameEquals("hubName"u8)) { - hubName = property.Value.GetString(); + hubName = prop.Value.GetString(); continue; } - if (property.NameEquals("connectionId"u8)) + if (prop.NameEquals("connectionId"u8)) { - connectionId = property.Value.GetString(); + connectionId = prop.Value.GetString(); continue; } - if (property.NameEquals("userId"u8)) + if (prop.NameEquals("userId"u8)) { - userId = property.Value.GetString(); + userId = prop.Value.GetString(); continue; } - if (property.NameEquals("errorMessage"u8)) + if (prop.NameEquals("errorMessage"u8)) { - errorMessage = property.Value.GetString(); + errorMessage = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new SignalRServiceClientConnectionDisconnectedEventData( timestamp, hubName, connectionId, userId, errorMessage, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -158,15 +168,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + SignalRServiceClientConnectionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SignalRServiceClientConnectionDisconnectedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeSignalRServiceClientConnectionDisconnectedEventData(document.RootElement, options); } default: @@ -174,35 +189,28 @@ SignalRServiceClientConnectionDisconnectedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static SignalRServiceClientConnectionDisconnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSignalRServiceClientConnectionDisconnectedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class SignalRServiceClientConnectionDisconnectedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, SignalRServiceClientConnectionDisconnectedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override SignalRServiceClientConnectionDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeSignalRServiceClientConnectionDisconnectedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSignalRServiceClientConnectionDisconnectedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs index 1542523c516c..49469ab1ad4d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs @@ -13,47 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event. public partial class SignalRServiceClientConnectionDisconnectedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The hub of connected client connection. /// The connection Id of connected client connection. - /// or is null. internal SignalRServiceClientConnectionDisconnectedEventData(string hubName, string connectionId) { - Argument.AssertNotNull(hubName, nameof(hubName)); - Argument.AssertNotNull(connectionId, nameof(connectionId)); - HubName = hubName; ConnectionId = connectionId; } @@ -64,30 +31,29 @@ internal SignalRServiceClientConnectionDisconnectedEventData(string hubName, str /// The connection Id of connected client connection. /// The user Id of connected client connection. /// The message of error that cause the client connection disconnected. - /// Keeps track of any properties unknown to the library. - internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary additionalBinaryDataProperties) { Timestamp = timestamp; HubName = hubName; ConnectionId = connectionId; UserId = userId; ErrorMessage = errorMessage; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SignalRServiceClientConnectionDisconnectedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which the event occurred. public DateTimeOffset? Timestamp { get; } + /// The hub of connected client connection. public string HubName { get; } + /// The connection Id of connected client connection. public string ConnectionId { get; } + /// The user Id of connected client connection. public string UserId { get; } + /// The message of error that cause the client connection disconnected. public string ErrorMessage { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StampKind.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StampKind.cs index e80161dd3493..ece991a978a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StampKind.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StampKind.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct StampKind : IEquatable { private readonly string _value; + /// App Service Plan is running on a public stamp. + private const string PublicValue = "Public"; + /// App Service Plan is running on an App Service Environment V1. + private const string AseV1Value = "AseV1"; + /// App Service Plan is running on an App Service Environment V2. + private const string AseV2Value = "AseV2"; /// Initializes a new instance of . + /// The value. /// is null. public StampKind(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string PublicValue = "Public"; - private const string AseV1Value = "AseV1"; - private const string AseV2Value = "AseV2"; + _value = value; + } /// App Service Plan is running on a public stamp. public static StampKind Public { get; } = new StampKind(PublicValue); + /// App Service Plan is running on an App Service Environment V1. public static StampKind AseV1 { get; } = new StampKind(AseV1Value); + /// App Service Plan is running on an App Service Environment V2. public static StampKind AseV2 { get; } = new StampKind(AseV2Value); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(StampKind left, StampKind right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(StampKind left, StampKind right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator StampKind(string value) => new StampKind(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator StampKind?(string value) => value == null ? null : new StampKind(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is StampKind other && Equals(other); - /// + + /// public bool Equals(StampKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.Serialization.cs index 3e9e4521a1f0..7837888d490c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event. [JsonConverter(typeof(StorageAsyncOperationInitiatedEventDataConverter))] - public partial class StorageAsyncOperationInitiatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageAsyncOperationInitiatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageAsyncOperationInitiatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageAsyncOperationInitiatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -83,15 +87,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -100,22 +104,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageAsyncOperationInitiatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageAsyncOperationInitiatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageAsyncOperationInitiatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageAsyncOperationInitiatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageAsyncOperationInitiatedEventData(document.RootElement, options); } - internal static StorageAsyncOperationInitiatedEventData DeserializeStorageAsyncOperationInitiatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageAsyncOperationInitiatedEventData DeserializeStorageAsyncOperationInitiatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -130,70 +139,68 @@ internal static StorageAsyncOperationInitiatedEventData DeserializeStorageAsyncO string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("contentType"u8)) + if (prop.NameEquals("contentType"u8)) { - contentType = property.Value.GetString(); + contentType = prop.Value.GetString(); continue; } - if (property.NameEquals("contentLength"u8)) + if (prop.NameEquals("contentLength"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentLength = property.Value.GetInt64(); + contentLength = prop.Value.GetInt64(); continue; } - if (property.NameEquals("blobType"u8)) + if (prop.NameEquals("blobType"u8)) { - blobType = property.Value.GetString(); + blobType = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageAsyncOperationInitiatedEventData( api, clientRequestId, @@ -205,13 +212,16 @@ internal static StorageAsyncOperationInitiatedEventData DeserializeStorageAsyncO sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -221,15 +231,20 @@ BinaryData IPersistableModel.Write(Mode } } - StorageAsyncOperationInitiatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageAsyncOperationInitiatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageAsyncOperationInitiatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageAsyncOperationInitiatedEventData(document.RootElement, options); } default: @@ -237,35 +252,28 @@ StorageAsyncOperationInitiatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageAsyncOperationInitiatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageAsyncOperationInitiatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageAsyncOperationInitiatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageAsyncOperationInitiatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageAsyncOperationInitiatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageAsyncOperationInitiatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageAsyncOperationInitiatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.cs index 3d056892fb36..346bccde1de0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageAsyncOperationInitiatedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event. public partial class StorageAsyncOperationInitiatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageAsyncOperationInitiatedEventData(object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - StorageDiagnostics = storageDiagnostics; } @@ -66,8 +34,8 @@ internal StorageAsyncOperationInitiatedEventData(object storageDiagnostics) /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageAsyncOperationInitiatedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, string url, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageAsyncOperationInitiatedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, string url, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -79,30 +47,33 @@ internal StorageAsyncOperationInitiatedEventData(string api, string clientReques Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageAsyncOperationInitiatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. public string ContentType { get; } + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. public long? ContentLength { get; } + /// The type of blob. public string BlobType { get; } + /// The path to the blob. public string Url { get; } + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs index 60a044fd8b4f..a62e5cd531ab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs @@ -14,47 +14,72 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct StorageBlobAccessTier : IEquatable { private readonly string _value; + /// The blob is in access tier Hot. + private const string HotValue = "Hot"; + /// The blob is in access tier Cool. + private const string CoolValue = "Cool"; + /// The blob is in access tier Cold. + private const string ColdValue = "Cold"; + /// The blob is in access tier Archive. + private const string ArchiveValue = "Archive"; + /// The blob is in access tier Default(Inferred). + private const string DefaultValue = "Default"; /// Initializes a new instance of . + /// The value. /// is null. public StorageBlobAccessTier(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string HotValue = "Hot"; - private const string CoolValue = "Cool"; - private const string ColdValue = "Cold"; - private const string ArchiveValue = "Archive"; - private const string DefaultValue = "Default"; + _value = value; + } /// The blob is in access tier Hot. public static StorageBlobAccessTier Hot { get; } = new StorageBlobAccessTier(HotValue); + /// The blob is in access tier Cool. public static StorageBlobAccessTier Cool { get; } = new StorageBlobAccessTier(CoolValue); + /// The blob is in access tier Cold. public static StorageBlobAccessTier Cold { get; } = new StorageBlobAccessTier(ColdValue); + /// The blob is in access tier Archive. public static StorageBlobAccessTier Archive { get; } = new StorageBlobAccessTier(ArchiveValue); + /// The blob is in access tier Default(Inferred). public static StorageBlobAccessTier Default { get; } = new StorageBlobAccessTier(DefaultValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(StorageBlobAccessTier left, StorageBlobAccessTier right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(StorageBlobAccessTier left, StorageBlobAccessTier right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator StorageBlobAccessTier(string value) => new StorageBlobAccessTier(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator StorageBlobAccessTier?(string value) => value == null ? null : new StorageBlobAccessTier(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is StorageBlobAccessTier other && Equals(other); - /// + + /// public bool Equals(StorageBlobAccessTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs index 9249e4e0fafd..1166c6af1f5f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event. [JsonConverter(typeof(StorageBlobCreatedEventDataConverter))] - public partial class StorageBlobCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageBlobCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageBlobCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -95,15 +99,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -112,22 +116,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageBlobCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageBlobCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageBlobCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageBlobCreatedEventData(document.RootElement, options); } - internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -145,89 +154,87 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("eTag"u8)) + if (prop.NameEquals("eTag"u8)) { - eTag = property.Value.GetString(); + eTag = prop.Value.GetString(); continue; } - if (property.NameEquals("contentType"u8)) + if (prop.NameEquals("contentType"u8)) { - contentType = property.Value.GetString(); + contentType = prop.Value.GetString(); continue; } - if (property.NameEquals("contentLength"u8)) + if (prop.NameEquals("contentLength"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentLength = property.Value.GetInt64(); + contentLength = prop.Value.GetInt64(); continue; } - if (property.NameEquals("contentOffset"u8)) + if (prop.NameEquals("contentOffset"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentOffset = property.Value.GetInt64(); + contentOffset = prop.Value.GetInt64(); continue; } - if (property.NameEquals("blobType"u8)) + if (prop.NameEquals("blobType"u8)) { - blobType = property.Value.GetString(); + blobType = prop.Value.GetString(); continue; } - if (property.NameEquals("accessTier"u8)) + if (prop.NameEquals("accessTier"u8)) { - accessTier = new StorageBlobAccessTier(property.Value.GetString()); + accessTier = new StorageBlobAccessTier(prop.Value.GetString()); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageBlobCreatedEventData( api, clientRequestId, @@ -242,13 +249,16 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -258,15 +268,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - StorageBlobCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageBlobCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageBlobCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageBlobCreatedEventData(document.RootElement, options); } default: @@ -274,35 +289,28 @@ StorageBlobCreatedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageBlobCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageBlobCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageBlobCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageBlobCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageBlobCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageBlobCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs index 515fe8a158d7..7ca2c998876d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs @@ -13,46 +13,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event. public partial class StorageBlobCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The current tier of the blob. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier, object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - AccessTier = accessTier; StorageDiagnostics = storageDiagnostics; } @@ -71,8 +39,8 @@ internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier, object st /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, StorageBlobAccessTier accessTier, string url, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, StorageBlobAccessTier accessTier, string url, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -87,36 +55,42 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageBlobCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The etag of the blob at the time this event was triggered. public string ETag { get; } + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. public string ContentType { get; } + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. public long? ContentLength { get; } + /// The offset of the blob in bytes. public long? ContentOffset { get; } + /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. public StorageBlobAccessTier AccessTier { get; } + /// The path to the blob. public string Url { get; } + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.Serialization.cs index 3d9359e1d2c4..ae91b50bb9e1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event. [JsonConverter(typeof(StorageBlobDeletedEventDataConverter))] - public partial class StorageBlobDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageBlobDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageBlobDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -78,15 +82,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -95,22 +99,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageBlobDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageBlobDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageBlobDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageBlobDeletedEventData(document.RootElement, options); } - internal static StorageBlobDeletedEventData DeserializeStorageBlobDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageBlobDeletedEventData DeserializeStorageBlobDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -124,61 +133,59 @@ internal static StorageBlobDeletedEventData DeserializeStorageBlobDeletedEventDa string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("contentType"u8)) + if (prop.NameEquals("contentType"u8)) { - contentType = property.Value.GetString(); + contentType = prop.Value.GetString(); continue; } - if (property.NameEquals("blobType"u8)) + if (prop.NameEquals("blobType"u8)) { - blobType = property.Value.GetString(); + blobType = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageBlobDeletedEventData( api, clientRequestId, @@ -189,13 +196,16 @@ internal static StorageBlobDeletedEventData DeserializeStorageBlobDeletedEventDa sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -205,15 +215,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - StorageBlobDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageBlobDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageBlobDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageBlobDeletedEventData(document.RootElement, options); } default: @@ -221,35 +236,28 @@ StorageBlobDeletedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageBlobDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageBlobDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageBlobDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageBlobDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageBlobDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageBlobDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.cs index 5b7c5c2a1c13..0baa01984e2b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobDeletedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event. public partial class StorageBlobDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageBlobDeletedEventData(object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - StorageDiagnostics = storageDiagnostics; } @@ -65,8 +33,8 @@ internal StorageBlobDeletedEventData(object storageDiagnostics) /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageBlobDeletedEventData(string api, string clientRequestId, string requestId, string contentType, string blobType, string url, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageBlobDeletedEventData(string api, string clientRequestId, string requestId, string contentType, string blobType, string url, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -77,28 +45,30 @@ internal StorageBlobDeletedEventData(string api, string clientRequestId, string Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageBlobDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. public string ContentType { get; } + /// The type of blob. public string BlobType { get; } + /// The path to the blob. public string Url { get; } + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs index a2360d79835a..a07366734f68 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event. [JsonConverter(typeof(StorageBlobInventoryPolicyCompletedEventDataConverter))] - public partial class StorageBlobInventoryPolicyCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageBlobInventoryPolicyCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobInventoryPolicyCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ScheduleDateTime)) { writer.WritePropertyName("scheduleDateTime"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("manifestBlobUrl"u8); writer.WriteStringValue(ManifestBlobUrl); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageBlobInventoryPolicyCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageBlobInventoryPolicyCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageBlobInventoryPolicyCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobInventoryPolicyCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageBlobInventoryPolicyCompletedEventData(document.RootElement, options); } - internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageBlobInventoryPolicyCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageBlobInventoryPolicyCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB string policyRunStatusMessage = default; string policyRunId = default; string manifestBlobUrl = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("scheduleDateTime"u8)) + if (prop.NameEquals("scheduleDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - scheduleDateTime = property.Value.GetDateTimeOffset("O"); + scheduleDateTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("accountName"u8)) + if (prop.NameEquals("accountName"u8)) { - accountName = property.Value.GetString(); + accountName = prop.Value.GetString(); continue; } - if (property.NameEquals("ruleName"u8)) + if (prop.NameEquals("ruleName"u8)) { - ruleName = property.Value.GetString(); + ruleName = prop.Value.GetString(); continue; } - if (property.NameEquals("policyRunStatus"u8)) + if (prop.NameEquals("policyRunStatus"u8)) { - policyRunStatus = property.Value.GetString(); + policyRunStatus = prop.Value.GetString(); continue; } - if (property.NameEquals("policyRunStatusMessage"u8)) + if (prop.NameEquals("policyRunStatusMessage"u8)) { - policyRunStatusMessage = property.Value.GetString(); + policyRunStatusMessage = prop.Value.GetString(); continue; } - if (property.NameEquals("policyRunId"u8)) + if (prop.NameEquals("policyRunId"u8)) { - policyRunId = property.Value.GetString(); + policyRunId = prop.Value.GetString(); continue; } - if (property.NameEquals("manifestBlobUrl"u8)) + if (prop.NameEquals("manifestBlobUrl"u8)) { - manifestBlobUrl = property.Value.GetString(); + manifestBlobUrl = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageBlobInventoryPolicyCompletedEventData( scheduleDateTime, accountName, @@ -172,13 +174,16 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB policyRunStatusMessage, policyRunId, manifestBlobUrl, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write } } - StorageBlobInventoryPolicyCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageBlobInventoryPolicyCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageBlobInventoryPolicyCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageBlobInventoryPolicyCompletedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ StorageBlobInventoryPolicyCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageBlobInventoryPolicyCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageBlobInventoryPolicyCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageBlobInventoryPolicyCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageBlobInventoryPolicyCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageBlobInventoryPolicyCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageBlobInventoryPolicyCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobInventoryPolicyCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs index a4eabe105daf..8bbbeaeac8eb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event. public partial class StorageBlobInventoryPolicyCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal StorageBlobInventoryPolicyCompletedEventData() @@ -58,8 +29,8 @@ internal StorageBlobInventoryPolicyCompletedEventData() /// The status message for inventory run. /// The policy run id for inventory run. /// The blob URL for manifest file for inventory run. - /// Keeps track of any properties unknown to the library. - internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary additionalBinaryDataProperties) { ScheduleDateTime = scheduleDateTime; AccountName = accountName; @@ -68,21 +39,27 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDa PolicyRunStatusMessage = policyRunStatusMessage; PolicyRunId = policyRunId; ManifestBlobUrl = manifestBlobUrl; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which inventory policy was scheduled. public DateTimeOffset? ScheduleDateTime { get; } + /// The account name for which inventory policy is registered. public string AccountName { get; } + /// The rule name for inventory policy. public string RuleName { get; } + /// The status of inventory run, it can be Succeeded/PartiallySucceeded/Failed. public string PolicyRunStatus { get; } + /// The status message for inventory run. public string PolicyRunStatusMessage { get; } + /// The policy run id for inventory run. public string PolicyRunId { get; } + /// The blob URL for manifest file for inventory run. public string ManifestBlobUrl { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.Serialization.cs index 13f5e0204844..464929bccc0a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event. [JsonConverter(typeof(StorageBlobRenamedEventDataConverter))] - public partial class StorageBlobRenamedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageBlobRenamedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageBlobRenamedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobRenamedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -73,15 +77,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -90,22 +94,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageBlobRenamedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageBlobRenamedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageBlobRenamedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobRenamedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageBlobRenamedEventData(document.RootElement, options); } - internal static StorageBlobRenamedEventData DeserializeStorageBlobRenamedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageBlobRenamedEventData DeserializeStorageBlobRenamedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -118,56 +127,54 @@ internal static StorageBlobRenamedEventData DeserializeStorageBlobRenamedEventDa string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("sourceUrl"u8)) + if (prop.NameEquals("sourceUrl"u8)) { - sourceUrl = property.Value.GetString(); + sourceUrl = prop.Value.GetString(); continue; } - if (property.NameEquals("destinationUrl"u8)) + if (prop.NameEquals("destinationUrl"u8)) { - destinationUrl = property.Value.GetString(); + destinationUrl = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageBlobRenamedEventData( api, clientRequestId, @@ -177,13 +184,16 @@ internal static StorageBlobRenamedEventData DeserializeStorageBlobRenamedEventDa sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -193,15 +203,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - StorageBlobRenamedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageBlobRenamedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageBlobRenamedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageBlobRenamedEventData(document.RootElement, options); } default: @@ -209,35 +224,28 @@ StorageBlobRenamedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageBlobRenamedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageBlobRenamedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageBlobRenamedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageBlobRenamedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageBlobRenamedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageBlobRenamedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobRenamedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.cs index a686ba607e5d..f26c3f392220 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobRenamedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event. public partial class StorageBlobRenamedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageBlobRenamedEventData(object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - StorageDiagnostics = storageDiagnostics; } @@ -64,8 +32,8 @@ internal StorageBlobRenamedEventData(object storageDiagnostics) /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageBlobRenamedEventData(string api, string clientRequestId, string requestId, string sourceUrl, string destinationUrl, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageBlobRenamedEventData(string api, string clientRequestId, string requestId, string sourceUrl, string destinationUrl, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -75,26 +43,27 @@ internal StorageBlobRenamedEventData(string api, string clientRequestId, string Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageBlobRenamedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The path to the blob that was renamed. public string SourceUrl { get; } + /// The new path to the blob after the rename operation. public string DestinationUrl { get; } + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs index 53c2369f5d7d..418737a70b50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event. [JsonConverter(typeof(StorageBlobTierChangedEventDataConverter))] - public partial class StorageBlobTierChangedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageBlobTierChangedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageBlobTierChangedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobTierChangedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -87,15 +91,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -104,22 +108,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageBlobTierChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageBlobTierChangedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageBlobTierChangedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageBlobTierChangedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageBlobTierChangedEventData(document.RootElement, options); } - internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChangedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChangedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -136,80 +145,78 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("contentType"u8)) + if (prop.NameEquals("contentType"u8)) { - contentType = property.Value.GetString(); + contentType = prop.Value.GetString(); continue; } - if (property.NameEquals("contentLength"u8)) + if (prop.NameEquals("contentLength"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentLength = property.Value.GetInt64(); + contentLength = prop.Value.GetInt64(); continue; } - if (property.NameEquals("blobType"u8)) + if (prop.NameEquals("blobType"u8)) { - blobType = property.Value.GetString(); + blobType = prop.Value.GetString(); continue; } - if (property.NameEquals("accessTier"u8)) + if (prop.NameEquals("accessTier"u8)) { - accessTier = new StorageBlobAccessTier(property.Value.GetString()); + accessTier = new StorageBlobAccessTier(prop.Value.GetString()); continue; } - if (property.NameEquals("previousTier"u8)) + if (prop.NameEquals("previousTier"u8)) { - previousTier = new StorageBlobAccessTier(property.Value.GetString()); + previousTier = new StorageBlobAccessTier(prop.Value.GetString()); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageBlobTierChangedEventData( api, clientRequestId, @@ -223,13 +230,16 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -239,15 +249,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - StorageBlobTierChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageBlobTierChangedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageBlobTierChangedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageBlobTierChangedEventData(document.RootElement, options); } default: @@ -255,35 +270,28 @@ StorageBlobTierChangedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageBlobTierChangedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageBlobTierChangedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageBlobTierChangedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageBlobTierChangedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageBlobTierChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageBlobTierChangedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobTierChangedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs index bfbac024a0f5..f94c772e78ff 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs @@ -13,47 +13,15 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event. public partial class StorageBlobTierChangedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The current tier of the blob. /// The previous tier of the blob. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - AccessTier = accessTier; PreviousTier = previousTier; StorageDiagnostics = storageDiagnostics; @@ -72,8 +40,8 @@ internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, Stora /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -87,34 +55,39 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageBlobTierChangedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. public string ContentType { get; } + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. public long? ContentLength { get; } + /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. public StorageBlobAccessTier AccessTier { get; } + /// The previous tier of the blob. public StorageBlobAccessTier PreviousTier { get; } + /// The path to the blob. public string Url { get; } + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.Serialization.cs index 4e31608a1a86..995704fc18e7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event. [JsonConverter(typeof(StorageDirectoryCreatedEventDataConverter))] - public partial class StorageDirectoryCreatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageDirectoryCreatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageDirectoryCreatedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageDirectoryCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -73,15 +77,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -90,22 +94,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageDirectoryCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageDirectoryCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageDirectoryCreatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageDirectoryCreatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageDirectoryCreatedEventData(document.RootElement, options); } - internal static StorageDirectoryCreatedEventData DeserializeStorageDirectoryCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageDirectoryCreatedEventData DeserializeStorageDirectoryCreatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -118,56 +127,54 @@ internal static StorageDirectoryCreatedEventData DeserializeStorageDirectoryCrea string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("eTag"u8)) + if (prop.NameEquals("eTag"u8)) { - eTag = property.Value.GetString(); + eTag = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageDirectoryCreatedEventData( api, clientRequestId, @@ -177,13 +184,16 @@ internal static StorageDirectoryCreatedEventData DeserializeStorageDirectoryCrea sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -193,15 +203,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - StorageDirectoryCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageDirectoryCreatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageDirectoryCreatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageDirectoryCreatedEventData(document.RootElement, options); } default: @@ -209,35 +224,28 @@ StorageDirectoryCreatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageDirectoryCreatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageDirectoryCreatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageDirectoryCreatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageDirectoryCreatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageDirectoryCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageDirectoryCreatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageDirectoryCreatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.cs index 4157b05a9ad3..edc305065c87 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryCreatedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event. public partial class StorageDirectoryCreatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageDirectoryCreatedEventData(object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - StorageDiagnostics = storageDiagnostics; } @@ -64,8 +32,8 @@ internal StorageDirectoryCreatedEventData(object storageDiagnostics) /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageDirectoryCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string url, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageDirectoryCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string url, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -75,26 +43,27 @@ internal StorageDirectoryCreatedEventData(string api, string clientRequestId, st Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageDirectoryCreatedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The etag of the directory at the time this event was triggered. public string ETag { get; } + /// The path to the directory. public string Url { get; } + /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.Serialization.cs index 5260b203643b..a26fffb69af0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event. [JsonConverter(typeof(StorageDirectoryDeletedEventDataConverter))] - public partial class StorageDirectoryDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageDirectoryDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageDirectoryDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageDirectoryDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -73,15 +77,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -90,22 +94,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageDirectoryDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageDirectoryDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageDirectoryDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageDirectoryDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageDirectoryDeletedEventData(document.RootElement, options); } - internal static StorageDirectoryDeletedEventData DeserializeStorageDirectoryDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageDirectoryDeletedEventData DeserializeStorageDirectoryDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -114,76 +123,77 @@ internal static StorageDirectoryDeletedEventData DeserializeStorageDirectoryDele string clientRequestId = default; string requestId = default; string url = default; - string recursive = default; + string recursiveString = default; string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("recursive"u8)) + if (prop.NameEquals("recursive"u8)) { - recursive = property.Value.GetString(); + recursiveString = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageDirectoryDeletedEventData( api, clientRequestId, requestId, url, - recursive, + recursiveString, sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -193,15 +203,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - StorageDirectoryDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageDirectoryDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageDirectoryDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageDirectoryDeletedEventData(document.RootElement, options); } default: @@ -209,35 +224,28 @@ StorageDirectoryDeletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageDirectoryDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageDirectoryDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageDirectoryDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageDirectoryDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageDirectoryDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageDirectoryDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageDirectoryDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.cs index 333241c07147..724930df678c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryDeletedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event. public partial class StorageDirectoryDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageDirectoryDeletedEventData(object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - StorageDiagnostics = storageDiagnostics; } @@ -60,12 +28,12 @@ internal StorageDirectoryDeletedEventData(object storageDiagnostics) /// A request id provided by the client of the storage API operation that triggered this event. /// The request id generated by the storage service for the storage API operation that triggered this event. /// The path to the deleted directory. - /// Is this event for a recursive delete operation. + /// /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageDirectoryDeletedEventData(string api, string clientRequestId, string requestId, string url, string recursiveString, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageDirectoryDeletedEventData(string api, string clientRequestId, string requestId, string url, string recursiveString, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -75,24 +43,24 @@ internal StorageDirectoryDeletedEventData(string api, string clientRequestId, st Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageDirectoryDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The path to the deleted directory. public string Url { get; } + /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.Serialization.cs index 6c9416aa7e31..6e0f28bf0c16 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event. [JsonConverter(typeof(StorageDirectoryRenamedEventDataConverter))] - public partial class StorageDirectoryRenamedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageDirectoryRenamedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageDirectoryRenamedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageDirectoryRenamedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Api)) { writer.WritePropertyName("api"u8); @@ -73,15 +77,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("storageDiagnostics"u8); writer.WriteObjectValue(StorageDiagnostics, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -90,22 +94,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageDirectoryRenamedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageDirectoryRenamedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageDirectoryRenamedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageDirectoryRenamedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageDirectoryRenamedEventData(document.RootElement, options); } - internal static StorageDirectoryRenamedEventData DeserializeStorageDirectoryRenamedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageDirectoryRenamedEventData DeserializeStorageDirectoryRenamedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -118,56 +127,54 @@ internal static StorageDirectoryRenamedEventData DeserializeStorageDirectoryRena string sequencer = default; string identity = default; object storageDiagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("api"u8)) + if (prop.NameEquals("api"u8)) { - api = property.Value.GetString(); + api = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("sourceUrl"u8)) + if (prop.NameEquals("sourceUrl"u8)) { - sourceUrl = property.Value.GetString(); + sourceUrl = prop.Value.GetString(); continue; } - if (property.NameEquals("destinationUrl"u8)) + if (prop.NameEquals("destinationUrl"u8)) { - destinationUrl = property.Value.GetString(); + destinationUrl = prop.Value.GetString(); continue; } - if (property.NameEquals("sequencer"u8)) + if (prop.NameEquals("sequencer"u8)) { - sequencer = property.Value.GetString(); + sequencer = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - identity = property.Value.GetString(); + identity = prop.Value.GetString(); continue; } - if (property.NameEquals("storageDiagnostics"u8)) + if (prop.NameEquals("storageDiagnostics"u8)) { - storageDiagnostics = property.Value.GetObject(); + storageDiagnostics = prop.Value.GetObject(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageDirectoryRenamedEventData( api, clientRequestId, @@ -177,13 +184,16 @@ internal static StorageDirectoryRenamedEventData DeserializeStorageDirectoryRena sequencer, identity, storageDiagnostics, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -193,15 +203,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - StorageDirectoryRenamedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageDirectoryRenamedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageDirectoryRenamedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageDirectoryRenamedEventData(document.RootElement, options); } default: @@ -209,35 +224,28 @@ StorageDirectoryRenamedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageDirectoryRenamedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageDirectoryRenamedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageDirectoryRenamedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageDirectoryRenamedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageDirectoryRenamedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageDirectoryRenamedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageDirectoryRenamedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.cs index 5028f28ecebd..8353a0bef282 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageDirectoryRenamedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event. public partial class StorageDirectoryRenamedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// is null. internal StorageDirectoryRenamedEventData(object storageDiagnostics) { - Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); - StorageDiagnostics = storageDiagnostics; } @@ -64,8 +32,8 @@ internal StorageDirectoryRenamedEventData(object storageDiagnostics) /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// Keeps track of any properties unknown to the library. - internal StorageDirectoryRenamedEventData(string api, string clientRequestId, string requestId, string sourceUrl, string destinationUrl, string sequencer, string identity, object storageDiagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageDirectoryRenamedEventData(string api, string clientRequestId, string requestId, string sourceUrl, string destinationUrl, string sequencer, string identity, object storageDiagnostics, IDictionary additionalBinaryDataProperties) { Api = api; ClientRequestId = clientRequestId; @@ -75,26 +43,27 @@ internal StorageDirectoryRenamedEventData(string api, string clientRequestId, st Sequencer = sequencer; Identity = identity; StorageDiagnostics = storageDiagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageDirectoryRenamedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name of the API/operation that triggered this event. public string Api { get; } + /// A request id provided by the client of the storage API operation that triggered this event. public string ClientRequestId { get; } + /// The request id generated by the storage service for the storage API operation that triggered this event. public string RequestId { get; } + /// The path to the directory that was renamed. public string SourceUrl { get; } + /// The new path to the directory after the rename operation. public string DestinationUrl { get; } + /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. public string Sequencer { get; } + /// The identity of the requester that triggered this event. public string Identity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs index a52a3baab266..71d5d27cea45 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs @@ -14,41 +14,62 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct StorageLifecycleCompletionStatus : IEquatable { private readonly string _value; + /// Completed. + private const string CompletedValue = "Completed"; + /// CompletedWithError. + private const string CompletedWithErrorValue = "CompletedWithError"; + /// Incomplete. + private const string IncompleteValue = "Incomplete"; /// Initializes a new instance of . + /// The value. /// is null. public StorageLifecycleCompletionStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string CompletedValue = "Completed"; - private const string CompletedWithErrorValue = "CompletedWithError"; - private const string IncompleteValue = "Incomplete"; + _value = value; + } /// Completed. public static StorageLifecycleCompletionStatus Completed { get; } = new StorageLifecycleCompletionStatus(CompletedValue); + /// CompletedWithError. public static StorageLifecycleCompletionStatus CompletedWithError { get; } = new StorageLifecycleCompletionStatus(CompletedWithErrorValue); + /// Incomplete. public static StorageLifecycleCompletionStatus Incomplete { get; } = new StorageLifecycleCompletionStatus(IncompleteValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(StorageLifecycleCompletionStatus left, StorageLifecycleCompletionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(StorageLifecycleCompletionStatus left, StorageLifecycleCompletionStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator StorageLifecycleCompletionStatus(string value) => new StorageLifecycleCompletionStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator StorageLifecycleCompletionStatus?(string value) => value == null ? null : new StorageLifecycleCompletionStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is StorageLifecycleCompletionStatus other && Equals(other); - /// + + /// public bool Equals(StorageLifecycleCompletionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs index 90e6449c04d9..55271ee6b6b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class StorageLifecyclePolicyActionSummaryDetail : IUtf8JsonSerializable, IJsonModel + /// Execution statistics of a specific policy action in a Blob Management cycle. + public partial class StorageLifecyclePolicyActionSummaryDetail : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageLifecyclePolicyActionSummaryDetail)} does not support writing '{format}' format."); } - if (Optional.IsDefined(TotalObjectsCount)) { writer.WritePropertyName("totalObjectsCount"u8); @@ -49,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("errorList"u8); writer.WriteStringValue(ErrorList); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageLifecyclePolicyActionSummaryDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageLifecyclePolicyActionSummaryDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageLifecyclePolicyActionSummaryDetail JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageLifecyclePolicyActionSummaryDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageLifecyclePolicyActionSummaryDetail(document.RootElement, options); } - internal static StorageLifecyclePolicyActionSummaryDetail DeserializeStorageLifecyclePolicyActionSummaryDetail(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageLifecyclePolicyActionSummaryDetail DeserializeStorageLifecyclePolicyActionSummaryDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,46 +93,47 @@ internal static StorageLifecyclePolicyActionSummaryDetail DeserializeStorageLife long? totalObjectsCount = default; long? successCount = default; string errorList = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("totalObjectsCount"u8)) + if (prop.NameEquals("totalObjectsCount"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - totalObjectsCount = property.Value.GetInt64(); + totalObjectsCount = prop.Value.GetInt64(); continue; } - if (property.NameEquals("successCount"u8)) + if (prop.NameEquals("successCount"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - successCount = property.Value.GetInt64(); + successCount = prop.Value.GetInt64(); continue; } - if (property.NameEquals("errorList"u8)) + if (prop.NameEquals("errorList"u8)) { - errorList = property.Value.GetString(); + errorList = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new StorageLifecyclePolicyActionSummaryDetail(totalObjectsCount, successCount, errorList, serializedAdditionalRawData); + return new StorageLifecyclePolicyActionSummaryDetail(totalObjectsCount, successCount, errorList, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +143,20 @@ BinaryData IPersistableModel.Write(Mo } } - StorageLifecyclePolicyActionSummaryDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageLifecyclePolicyActionSummaryDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageLifecyclePolicyActionSummaryDetail PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageLifecyclePolicyActionSummaryDetail(document.RootElement, options); } default: @@ -154,22 +164,7 @@ StorageLifecyclePolicyActionSummaryDetail IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageLifecyclePolicyActionSummaryDetail FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageLifecyclePolicyActionSummaryDetail(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.cs index 7593c3cbb679..e9c046c93bc6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyActionSummaryDetail.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Execution statistics of a specific policy action in a Blob Management cycle. public partial class StorageLifecyclePolicyActionSummaryDetail { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal StorageLifecyclePolicyActionSummaryDetail() @@ -54,19 +25,21 @@ internal StorageLifecyclePolicyActionSummaryDetail() /// Total number of objects to be acted on by this action. /// Number of success operations of this action. /// Error messages of this action if any. - /// Keeps track of any properties unknown to the library. - internal StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount, long? successCount, string errorList, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount, long? successCount, string errorList, IDictionary additionalBinaryDataProperties) { TotalObjectsCount = totalObjectsCount; SuccessCount = successCount; ErrorList = errorList; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Total number of objects to be acted on by this action. public long? TotalObjectsCount { get; } + /// Number of success operations of this action. public long? SuccessCount { get; } + /// Error messages of this action if any. public string ErrorList { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.Serialization.cs index 1da965af00b4..259571a0249a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event. [JsonConverter(typeof(StorageLifecyclePolicyCompletedEventDataConverter))] - public partial class StorageLifecyclePolicyCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageLifecyclePolicyCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageLifecyclePolicyCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageLifecyclePolicyCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ScheduleTime)) { writer.WritePropertyName("scheduleTime"u8); @@ -51,15 +55,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(TierToArchiveSummary, options); writer.WritePropertyName("tierToColdSummary"u8); writer.WriteObjectValue(TierToColdSummary, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +72,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageLifecyclePolicyCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageLifecyclePolicyCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageLifecyclePolicyCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageLifecyclePolicyCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageLifecyclePolicyCompletedEventData(document.RootElement, options); } - internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifecyclePolicyCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifecyclePolicyCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,46 +103,44 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = default; StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = default; StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("scheduleTime"u8)) + if (prop.NameEquals("scheduleTime"u8)) { - scheduleTime = property.Value.GetString(); + scheduleTime = prop.Value.GetString(); continue; } - if (property.NameEquals("policyRunSummary"u8)) + if (prop.NameEquals("policyRunSummary"u8)) { - policyRunSummary = StorageLifecyclePolicyRunSummary.DeserializeStorageLifecyclePolicyRunSummary(property.Value, options); + policyRunSummary = StorageLifecyclePolicyRunSummary.DeserializeStorageLifecyclePolicyRunSummary(prop.Value, options); continue; } - if (property.NameEquals("deleteSummary"u8)) + if (prop.NameEquals("deleteSummary"u8)) { - deleteSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); + deleteSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(prop.Value, options); continue; } - if (property.NameEquals("tierToCoolSummary"u8)) + if (prop.NameEquals("tierToCoolSummary"u8)) { - tierToCoolSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); + tierToCoolSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(prop.Value, options); continue; } - if (property.NameEquals("tierToArchiveSummary"u8)) + if (prop.NameEquals("tierToArchiveSummary"u8)) { - tierToArchiveSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); + tierToArchiveSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(prop.Value, options); continue; } - if (property.NameEquals("tierToColdSummary"u8)) + if (prop.NameEquals("tierToColdSummary"u8)) { - tierToColdSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); + tierToColdSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageLifecyclePolicyCompletedEventData( scheduleTime, policyRunSummary, @@ -141,13 +148,16 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec tierToCoolSummary, tierToArchiveSummary, tierToColdSummary, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -157,15 +167,20 @@ BinaryData IPersistableModel.Write(Mod } } - StorageLifecyclePolicyCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageLifecyclePolicyCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageLifecyclePolicyCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageLifecyclePolicyCompletedEventData(document.RootElement, options); } default: @@ -173,35 +188,28 @@ StorageLifecyclePolicyCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageLifecyclePolicyCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageLifecyclePolicyCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageLifecyclePolicyCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageLifecyclePolicyCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageLifecyclePolicyCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageLifecyclePolicyCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageLifecyclePolicyCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.cs index 9619c44a21f2..1fd4077a92f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event. public partial class StorageLifecyclePolicyCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Policy execution summary which shows the completion status of a LCM run". @@ -51,15 +22,8 @@ public partial class StorageLifecyclePolicyCompletedEventData /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. - /// , , , or is null. internal StorageLifecyclePolicyCompletedEventData(StorageLifecyclePolicyRunSummary policyRunSummary, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary) { - Argument.AssertNotNull(policyRunSummary, nameof(policyRunSummary)); - Argument.AssertNotNull(deleteSummary, nameof(deleteSummary)); - Argument.AssertNotNull(tierToCoolSummary, nameof(tierToCoolSummary)); - Argument.AssertNotNull(tierToArchiveSummary, nameof(tierToArchiveSummary)); - Argument.AssertNotNull(tierToColdSummary, nameof(tierToColdSummary)); - PolicyRunSummary = policyRunSummary; DeleteSummary = deleteSummary; TierToCoolSummary = tierToCoolSummary; @@ -74,8 +38,8 @@ internal StorageLifecyclePolicyCompletedEventData(StorageLifecyclePolicyRunSumma /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. - /// Keeps track of any properties unknown to the library. - internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyRunSummary policyRunSummary, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyRunSummary policyRunSummary, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, IDictionary additionalBinaryDataProperties) { ScheduleTime = scheduleTime; PolicyRunSummary = policyRunSummary; @@ -83,24 +47,24 @@ internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLi TierToCoolSummary = tierToCoolSummary; TierToArchiveSummary = tierToArchiveSummary; TierToColdSummary = tierToColdSummary; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageLifecyclePolicyCompletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time the policy task was scheduled. public string ScheduleTime { get; } + /// Policy execution summary which shows the completion status of a LCM run". public StorageLifecyclePolicyRunSummary PolicyRunSummary { get; } + /// Execution statistics of a specific policy action in a Blob Management cycle. public StorageLifecyclePolicyActionSummaryDetail DeleteSummary { get; } + /// Execution statistics of a specific policy action in a Blob Management cycle. public StorageLifecyclePolicyActionSummaryDetail TierToCoolSummary { get; } + /// Execution statistics of a specific policy action in a Blob Management cycle. public StorageLifecyclePolicyActionSummaryDetail TierToArchiveSummary { get; } + /// Execution statistics of a specific policy action in a Blob Management cycle. public StorageLifecyclePolicyActionSummaryDetail TierToColdSummary { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs index 301d5f6d258b..9f36cbf7a744 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs @@ -9,14 +9,19 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class StorageLifecyclePolicyRunSummary : IUtf8JsonSerializable, IJsonModel + /// Policy run status of an account in a Blob Management cycle. + public partial class StorageLifecyclePolicyRunSummary : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageLifecyclePolicyRunSummary() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +33,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageLifecyclePolicyRunSummary)} does not support writing '{format}' format."); } - writer.WritePropertyName("completionStatus"u8); writer.WriteStringValue(CompletionStatus.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +57,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageLifecyclePolicyRunSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageLifecyclePolicyRunSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageLifecyclePolicyRunSummary JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageLifecyclePolicyRunSummary)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement, options); } - internal static StorageLifecyclePolicyRunSummary DeserializeStorageLifecyclePolicyRunSummary(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageLifecyclePolicyRunSummary DeserializeStorageLifecyclePolicyRunSummary(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } StorageLifecycleCompletionStatus completionStatus = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("completionStatus"u8)) + if (prop.NameEquals("completionStatus"u8)) { - completionStatus = new StorageLifecycleCompletionStatus(property.Value.GetString()); + completionStatus = new StorageLifecycleCompletionStatus(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new StorageLifecyclePolicyRunSummary(completionStatus, serializedAdditionalRawData); + return new StorageLifecyclePolicyRunSummary(completionStatus, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - StorageLifecyclePolicyRunSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageLifecyclePolicyRunSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageLifecyclePolicyRunSummary PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement, options); } default: @@ -121,22 +136,7 @@ StorageLifecyclePolicyRunSummary IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageLifecyclePolicyRunSummary FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs index 11674a6b8cf6..c873ef4c968e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Policy run status of an account in a Blob Management cycle. public partial class StorageLifecyclePolicyRunSummary { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Policy status can be Completed/CompletedWithError/Incomplete. @@ -54,16 +25,11 @@ internal StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus compl /// Initializes a new instance of . /// Policy status can be Completed/CompletedWithError/Incomplete. - /// Keeps track of any properties unknown to the library. - internal StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus, IDictionary additionalBinaryDataProperties) { CompletionStatus = completionStatus; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageLifecyclePolicyRunSummary() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Policy status can be Completed/CompletedWithError/Incomplete. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs index 098440d3ea86..4109fb335a56 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskAssignmentCompleted event. [JsonConverter(typeof(StorageTaskAssignmentCompletedEventDataConverter))] - public partial class StorageTaskAssignmentCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageTaskAssignmentCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageTaskAssignmentCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskAssignmentCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -58,15 +62,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("summaryReportBlobUrl"u8); writer.WriteStringValue(SummaryReportBlobUri.AbsoluteUri); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,87 +79,93 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageTaskAssignmentCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageTaskAssignmentCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageTaskAssignmentCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskAssignmentCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageTaskAssignmentCompletedEventData(document.RootElement, options); } - internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAssignmentCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAssignmentCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } StorageTaskAssignmentCompletedStatus? status = default; - DateTimeOffset? completedDateTime = default; + DateTimeOffset? completedOn = default; string taskExecutionId = default; string taskName = default; - Uri summaryReportBlobUrl = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + Uri summaryReportBlobUri = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new StorageTaskAssignmentCompletedStatus(property.Value.GetString()); + status = new StorageTaskAssignmentCompletedStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("completedDateTime"u8)) + if (prop.NameEquals("completedDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - completedDateTime = property.Value.GetDateTimeOffset("O"); + completedOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("taskExecutionId"u8)) + if (prop.NameEquals("taskExecutionId"u8)) { - taskExecutionId = property.Value.GetString(); + taskExecutionId = prop.Value.GetString(); continue; } - if (property.NameEquals("taskName"u8)) + if (prop.NameEquals("taskName"u8)) { - taskName = property.Value.GetString(); + taskName = prop.Value.GetString(); continue; } - if (property.NameEquals("summaryReportBlobUrl"u8)) + if (prop.NameEquals("summaryReportBlobUrl"u8)) { - summaryReportBlobUrl = new Uri(property.Value.GetString()); + summaryReportBlobUri = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageTaskAssignmentCompletedEventData( status, - completedDateTime, + completedOn, taskExecutionId, taskName, - summaryReportBlobUrl, - serializedAdditionalRawData); + summaryReportBlobUri, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -165,15 +175,20 @@ BinaryData IPersistableModel.Write(Mode } } - StorageTaskAssignmentCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageTaskAssignmentCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageTaskAssignmentCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageTaskAssignmentCompletedEventData(document.RootElement, options); } default: @@ -181,35 +196,28 @@ StorageTaskAssignmentCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageTaskAssignmentCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageTaskAssignmentCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageTaskAssignmentCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageTaskAssignmentCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageTaskAssignmentCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageTaskAssignmentCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageTaskAssignmentCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs index 91f49d744b3d..faee441db40f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskAssignmentCompleted event. public partial class StorageTaskAssignmentCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The summary report blob url for a storage task. - /// is null. internal StorageTaskAssignmentCompletedEventData(Uri summaryReportBlobUri) { - Argument.AssertNotNull(summaryReportBlobUri, nameof(summaryReportBlobUri)); - SummaryReportBlobUri = summaryReportBlobUri; } @@ -61,30 +29,29 @@ internal StorageTaskAssignmentCompletedEventData(Uri summaryReportBlobUri) /// The execution id for a storage task. /// The task name for a storage task. /// The summary report blob url for a storage task. - /// Keeps track of any properties unknown to the library. - internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status, DateTimeOffset? completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status, DateTimeOffset? completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary additionalBinaryDataProperties) { Status = status; CompletedOn = completedOn; TaskExecutionId = taskExecutionId; TaskName = taskName; SummaryReportBlobUri = summaryReportBlobUri; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageTaskAssignmentCompletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The status for a storage task. public StorageTaskAssignmentCompletedStatus? Status { get; } + /// The time at which a storage task was completed. public DateTimeOffset? CompletedOn { get; } + /// The execution id for a storage task. public string TaskExecutionId { get; } + /// The task name for a storage task. public string TaskName { get; } + /// The summary report blob url for a storage task. public Uri SummaryReportBlobUri { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedStatus.cs index efa113f414d9..a29dfff9c0c1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedStatus.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct StorageTaskAssignmentCompletedStatus : IEquatable { private readonly string _value; + /// Succeeded. + private const string SucceededValue = "Succeeded"; + /// Failed. + private const string FailedValue = "Failed"; /// Initializes a new instance of . + /// The value. /// is null. public StorageTaskAssignmentCompletedStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; + _value = value; + } /// Succeeded. public static StorageTaskAssignmentCompletedStatus Succeeded { get; } = new StorageTaskAssignmentCompletedStatus(SucceededValue); + /// Failed. public static StorageTaskAssignmentCompletedStatus Failed { get; } = new StorageTaskAssignmentCompletedStatus(FailedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(StorageTaskAssignmentCompletedStatus left, StorageTaskAssignmentCompletedStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(StorageTaskAssignmentCompletedStatus left, StorageTaskAssignmentCompletedStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator StorageTaskAssignmentCompletedStatus(string value) => new StorageTaskAssignmentCompletedStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator StorageTaskAssignmentCompletedStatus?(string value) => value == null ? null : new StorageTaskAssignmentCompletedStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is StorageTaskAssignmentCompletedStatus other && Equals(other); - /// + + /// public bool Equals(StorageTaskAssignmentCompletedStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs index c299771c8f96..459963e74335 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskAssignmentQueued event. [JsonConverter(typeof(StorageTaskAssignmentQueuedEventDataConverter))] - public partial class StorageTaskAssignmentQueuedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageTaskAssignmentQueuedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskAssignmentQueuedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(QueuedOn)) { writer.WritePropertyName("queuedDateTime"u8); @@ -46,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("taskExecutionId"u8); writer.WriteStringValue(TaskExecutionId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,59 +62,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageTaskAssignmentQueuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageTaskAssignmentQueuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageTaskAssignmentQueuedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskAssignmentQueuedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageTaskAssignmentQueuedEventData(document.RootElement, options); } - internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssignmentQueuedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssignmentQueuedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DateTimeOffset? queuedDateTime = default; + DateTimeOffset? queuedOn = default; string taskExecutionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queuedDateTime"u8)) + if (prop.NameEquals("queuedDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - queuedDateTime = property.Value.GetDateTimeOffset("O"); + queuedOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("taskExecutionId"u8)) + if (prop.NameEquals("taskExecutionId"u8)) { - taskExecutionId = property.Value.GetString(); + taskExecutionId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new StorageTaskAssignmentQueuedEventData(queuedDateTime, taskExecutionId, serializedAdditionalRawData); + return new StorageTaskAssignmentQueuedEventData(queuedOn, taskExecutionId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -125,15 +130,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - StorageTaskAssignmentQueuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageTaskAssignmentQueuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageTaskAssignmentQueuedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageTaskAssignmentQueuedEventData(document.RootElement, options); } default: @@ -141,35 +151,28 @@ StorageTaskAssignmentQueuedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageTaskAssignmentQueuedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageTaskAssignmentQueuedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageTaskAssignmentQueuedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageTaskAssignmentQueuedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageTaskAssignmentQueuedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageTaskAssignmentQueuedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageTaskAssignmentQueuedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs index c03472230485..9be662e37565 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskAssignmentQueued event. public partial class StorageTaskAssignmentQueuedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal StorageTaskAssignmentQueuedEventData() @@ -53,16 +24,17 @@ internal StorageTaskAssignmentQueuedEventData() /// Initializes a new instance of . /// The time at which a storage task was queued. /// The execution id for a storage task. - /// Keeps track of any properties unknown to the library. - internal StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn, string taskExecutionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn, string taskExecutionId, IDictionary additionalBinaryDataProperties) { QueuedOn = queuedOn; TaskExecutionId = taskExecutionId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which a storage task was queued. public DateTimeOffset? QueuedOn { get; } + /// The execution id for a storage task. public string TaskExecutionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs index 7899225304e6..210c2b608f39 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskCompleted event. [JsonConverter(typeof(StorageTaskCompletedEventDataConverter))] - public partial class StorageTaskCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageTaskCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal StorageTaskCompletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -58,15 +62,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("summaryReportBlobUrl"u8); writer.WriteStringValue(SummaryReportBlobUri.AbsoluteUri); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,22 +79,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageTaskCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageTaskCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageTaskCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageTaskCompletedEventData(document.RootElement, options); } - internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -99,63 +108,64 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; - Uri summaryReportBlobUrl = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + Uri summaryReportBlobUri = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new StorageTaskCompletedStatus(property.Value.GetString()); + status = new StorageTaskCompletedStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("completedDateTime"u8)) + if (prop.NameEquals("completedDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - completedDateTime = property.Value.GetDateTimeOffset("O"); + completedDateTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("taskExecutionId"u8)) + if (prop.NameEquals("taskExecutionId"u8)) { - taskExecutionId = property.Value.GetString(); + taskExecutionId = prop.Value.GetString(); continue; } - if (property.NameEquals("taskName"u8)) + if (prop.NameEquals("taskName"u8)) { - taskName = property.Value.GetString(); + taskName = prop.Value.GetString(); continue; } - if (property.NameEquals("summaryReportBlobUrl"u8)) + if (prop.NameEquals("summaryReportBlobUrl"u8)) { - summaryReportBlobUrl = new Uri(property.Value.GetString()); + summaryReportBlobUri = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new StorageTaskCompletedEventData( status, completedDateTime, taskExecutionId, taskName, - summaryReportBlobUrl, - serializedAdditionalRawData); + summaryReportBlobUri, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -165,15 +175,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - StorageTaskCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageTaskCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageTaskCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageTaskCompletedEventData(document.RootElement, options); } default: @@ -181,35 +196,28 @@ StorageTaskCompletedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageTaskCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageTaskCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageTaskCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageTaskCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageTaskCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageTaskCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageTaskCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs index 6819b79a2911..a9916f6cec41 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs @@ -13,45 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskCompleted event. public partial class StorageTaskCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The summary report blob url for a storage task. - /// is null. internal StorageTaskCompletedEventData(Uri summaryReportBlobUri) { - Argument.AssertNotNull(summaryReportBlobUri, nameof(summaryReportBlobUri)); - SummaryReportBlobUri = summaryReportBlobUri; } @@ -61,30 +29,29 @@ internal StorageTaskCompletedEventData(Uri summaryReportBlobUri) /// The execution id for a storage task. /// The task name for a storage task. /// The summary report blob url for a storage task. - /// Keeps track of any properties unknown to the library. - internal StorageTaskCompletedEventData(StorageTaskCompletedStatus? status, DateTimeOffset? completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageTaskCompletedEventData(StorageTaskCompletedStatus? status, DateTimeOffset? completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary additionalBinaryDataProperties) { Status = status; CompletedDateTime = completedDateTime; TaskExecutionId = taskExecutionId; TaskName = taskName; SummaryReportBlobUri = summaryReportBlobUri; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal StorageTaskCompletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The status for a storage task. public StorageTaskCompletedStatus? Status { get; } + /// The time at which a storage task was completed. public DateTimeOffset? CompletedDateTime { get; } + /// The execution id for a storage task. public string TaskExecutionId { get; } + /// The task name for a storage task. public string TaskName { get; } + /// The summary report blob url for a storage task. public Uri SummaryReportBlobUri { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedStatus.cs index a7df13a5681c..4ed8a4d433dd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedStatus.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedStatus.cs @@ -14,38 +14,57 @@ namespace Azure.Messaging.EventGrid.SystemEvents public readonly partial struct StorageTaskCompletedStatus : IEquatable { private readonly string _value; + /// Succeeded. + private const string SucceededValue = "Succeeded"; + /// Failed. + private const string FailedValue = "Failed"; /// Initializes a new instance of . + /// The value. /// is null. public StorageTaskCompletedStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; + _value = value; + } /// Succeeded. public static StorageTaskCompletedStatus Succeeded { get; } = new StorageTaskCompletedStatus(SucceededValue); + /// Failed. public static StorageTaskCompletedStatus Failed { get; } = new StorageTaskCompletedStatus(FailedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(StorageTaskCompletedStatus left, StorageTaskCompletedStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(StorageTaskCompletedStatus left, StorageTaskCompletedStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator StorageTaskCompletedStatus(string value) => new StorageTaskCompletedStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator StorageTaskCompletedStatus?(string value) => value == null ? null : new StorageTaskCompletedStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is StorageTaskCompletedStatus other && Equals(other); - /// + + /// public bool Equals(StorageTaskCompletedStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs index 4a3916f04a1f..99812c387f56 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskQueued event. [JsonConverter(typeof(StorageTaskQueuedEventDataConverter))] - public partial class StorageTaskQueuedEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageTaskQueuedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskQueuedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(QueuedDateTime)) { writer.WritePropertyName("queuedDateTime"u8); @@ -46,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("taskExecutionId"u8); writer.WriteStringValue(TaskExecutionId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,59 +62,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - StorageTaskQueuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + StorageTaskQueuedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual StorageTaskQueuedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(StorageTaskQueuedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeStorageTaskQueuedEventData(document.RootElement, options); } - internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("queuedDateTime"u8)) + if (prop.NameEquals("queuedDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - queuedDateTime = property.Value.GetDateTimeOffset("O"); + queuedDateTime = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("taskExecutionId"u8)) + if (prop.NameEquals("taskExecutionId"u8)) { - taskExecutionId = property.Value.GetString(); + taskExecutionId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, serializedAdditionalRawData); + return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -125,15 +130,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - StorageTaskQueuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + StorageTaskQueuedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual StorageTaskQueuedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeStorageTaskQueuedEventData(document.RootElement, options); } default: @@ -141,35 +151,28 @@ StorageTaskQueuedEventData IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static StorageTaskQueuedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeStorageTaskQueuedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class StorageTaskQueuedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, StorageTaskQueuedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override StorageTaskQueuedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeStorageTaskQueuedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageTaskQueuedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs index 79169b81a03e..20d1ec45d266 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for an Microsoft.Storage.StorageTaskQueued event. public partial class StorageTaskQueuedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal StorageTaskQueuedEventData() @@ -53,16 +24,17 @@ internal StorageTaskQueuedEventData() /// Initializes a new instance of . /// The time at which a storage task was queued. /// The execution id for a storage task. - /// Keeps track of any properties unknown to the library. - internal StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime, string taskExecutionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime, string taskExecutionId, IDictionary additionalBinaryDataProperties) { QueuedDateTime = queuedDateTime; TaskExecutionId = taskExecutionId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The time at which a storage task was queued. public DateTimeOffset? QueuedDateTime { get; } + /// The execution id for a storage task. public string TaskExecutionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.Serialization.cs index 9c2126a819c6..845f13ee1d58 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.Serialization.cs @@ -10,15 +10,23 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// Schema of the Data property of an EventGridEvent for a + /// Microsoft.EventGrid.SubscriptionDeletedEvent event. + /// [JsonConverter(typeof(SubscriptionDeletedEventDataConverter))] - public partial class SubscriptionDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class SubscriptionDeletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SubscriptionDeletedEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,23 +38,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SubscriptionDeletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("eventSubscriptionId"u8); writer.WriteStringValue(EventSubscriptionId); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,49 +62,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubscriptionDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SubscriptionDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SubscriptionDeletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SubscriptionDeletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSubscriptionDeletedEventData(document.RootElement, options); } - internal static SubscriptionDeletedEventData DeserializeSubscriptionDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SubscriptionDeletedEventData DeserializeSubscriptionDeletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string eventSubscriptionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("eventSubscriptionId"u8)) + if (prop.NameEquals("eventSubscriptionId"u8)) { - eventSubscriptionId = property.Value.GetString(); + eventSubscriptionId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new SubscriptionDeletedEventData(eventSubscriptionId, serializedAdditionalRawData); + return new SubscriptionDeletedEventData(eventSubscriptionId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +120,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - SubscriptionDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + SubscriptionDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SubscriptionDeletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeSubscriptionDeletedEventData(document.RootElement, options); } default: @@ -123,35 +141,28 @@ SubscriptionDeletedEventData IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static SubscriptionDeletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSubscriptionDeletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class SubscriptionDeletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, SubscriptionDeletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override SubscriptionDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeSubscriptionDeletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionDeletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.cs index 6056e51310b1..caf64a88dbb1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.cs @@ -16,60 +16,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// public partial class SubscriptionDeletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Azure resource ID of the deleted event subscription. - /// is null. internal SubscriptionDeletedEventData(string eventSubscriptionId) { - Argument.AssertNotNull(eventSubscriptionId, nameof(eventSubscriptionId)); - EventSubscriptionId = eventSubscriptionId; } /// Initializes a new instance of . /// The Azure resource ID of the deleted event subscription. - /// Keeps track of any properties unknown to the library. - internal SubscriptionDeletedEventData(string eventSubscriptionId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SubscriptionDeletedEventData(string eventSubscriptionId, IDictionary additionalBinaryDataProperties) { EventSubscriptionId = eventSubscriptionId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SubscriptionDeletedEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Azure resource ID of the deleted event subscription. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.Serialization.cs index 14a7424fe082..00e8ca86f53b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event. [JsonConverter(typeof(SubscriptionValidationEventDataConverter))] - public partial class SubscriptionValidationEventData : IUtf8JsonSerializable, IJsonModel + public partial class SubscriptionValidationEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal SubscriptionValidationEventData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,25 +35,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SubscriptionValidationEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("validationCode"u8); writer.WriteStringValue(ValidationCode); writer.WritePropertyName("validationUrl"u8); writer.WriteStringValue(ValidationUrl); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -57,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubscriptionValidationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SubscriptionValidationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SubscriptionValidationEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SubscriptionValidationEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSubscriptionValidationEventData(document.RootElement, options); } - internal static SubscriptionValidationEventData DeserializeSubscriptionValidationEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SubscriptionValidationEventData DeserializeSubscriptionValidationEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string validationCode = default; string validationUrl = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("validationCode"u8)) + if (prop.NameEquals("validationCode"u8)) { - validationCode = property.Value.GetString(); + validationCode = prop.Value.GetString(); continue; } - if (property.NameEquals("validationUrl"u8)) + if (prop.NameEquals("validationUrl"u8)) { - validationUrl = property.Value.GetString(); + validationUrl = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new SubscriptionValidationEventData(validationCode, validationUrl, serializedAdditionalRawData); + return new SubscriptionValidationEventData(validationCode, validationUrl, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -115,15 +125,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - SubscriptionValidationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + SubscriptionValidationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SubscriptionValidationEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeSubscriptionValidationEventData(document.RootElement, options); } default: @@ -131,35 +146,28 @@ SubscriptionValidationEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static SubscriptionValidationEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSubscriptionValidationEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class SubscriptionValidationEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, SubscriptionValidationEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override SubscriptionValidationEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeSubscriptionValidationEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionValidationEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.cs index a9db22f6fe88..c66fe60b1c8e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event. public partial class SubscriptionValidationEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// @@ -56,12 +27,8 @@ public partial class SubscriptionValidationEventData /// To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, /// or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). /// - /// or is null. internal SubscriptionValidationEventData(string validationCode, string validationUrl) { - Argument.AssertNotNull(validationCode, nameof(validationCode)); - Argument.AssertNotNull(validationUrl, nameof(validationUrl)); - ValidationCode = validationCode; ValidationUrl = validationUrl; } @@ -77,17 +44,12 @@ internal SubscriptionValidationEventData(string validationCode, string validatio /// To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, /// or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). /// - /// Keeps track of any properties unknown to the library. - internal SubscriptionValidationEventData(string validationCode, string validationUrl, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SubscriptionValidationEventData(string validationCode, string validationUrl, IDictionary additionalBinaryDataProperties) { ValidationCode = validationCode; ValidationUrl = validationUrl; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SubscriptionValidationEventData() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// @@ -96,6 +58,7 @@ internal SubscriptionValidationEventData() /// or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). /// public string ValidationCode { get; } + /// /// The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). /// To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.Serialization.cs index c1de9b6d0fff..8c6c572041e8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.Serialization.cs @@ -10,15 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// + /// To complete an event subscription validation handshake, a subscriber can use + /// either the validationCode or the validationUrl received in a + /// SubscriptionValidationEvent. When the validationCode is used, the + /// SubscriptionValidationResponse can be used to build the response. + /// [JsonConverter(typeof(SubscriptionValidationResponseConverter))] - public partial class SubscriptionValidationResponse : IUtf8JsonSerializable, IJsonModel + public partial class SubscriptionValidationResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,23 +35,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SubscriptionValidationResponse)} does not support writing '{format}' format."); } - writer.WritePropertyName("validationResponse"u8); writer.WriteStringValue(ValidationResponse); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,49 +59,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubscriptionValidationResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + SubscriptionValidationResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual SubscriptionValidationResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(SubscriptionValidationResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeSubscriptionValidationResponse(document.RootElement, options); } - internal static SubscriptionValidationResponse DeserializeSubscriptionValidationResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static SubscriptionValidationResponse DeserializeSubscriptionValidationResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string validationResponse = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("validationResponse"u8)) + if (prop.NameEquals("validationResponse"u8)) { - validationResponse = property.Value.GetString(); + validationResponse = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new SubscriptionValidationResponse(validationResponse, serializedAdditionalRawData); + return new SubscriptionValidationResponse(validationResponse, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +117,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - SubscriptionValidationResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + SubscriptionValidationResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual SubscriptionValidationResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeSubscriptionValidationResponse(document.RootElement, options); } default: @@ -123,35 +138,28 @@ SubscriptionValidationResponse IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static SubscriptionValidationResponse FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSubscriptionValidationResponse(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class SubscriptionValidationResponseConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, SubscriptionValidationResponse model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override SubscriptionValidationResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeSubscriptionValidationResponse(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionValidationResponse(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.cs index fbd429fab567..5f25887d9cad 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.cs @@ -18,55 +18,23 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// public partial class SubscriptionValidationResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. - /// is null. internal SubscriptionValidationResponse(string validationResponse) { - Argument.AssertNotNull(validationResponse, nameof(validationResponse)); - ValidationResponse = validationResponse; } /// Initializes a new instance of . /// The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. - /// Keeps track of any properties unknown to the library. - internal SubscriptionValidationResponse(string validationResponse, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal SubscriptionValidationResponse(string validationResponse, IDictionary additionalBinaryDataProperties) { ValidationResponse = validationResponse; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.Serialization.cs index f8c54a0985c3..9590bf82cb38 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event. [JsonConverter(typeof(WebAppServicePlanUpdatedEventDataConverter))] - public partial class WebAppServicePlanUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebAppServicePlanUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebAppServicePlanUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppServicePlanEventTypeDetail)) { writer.WritePropertyName("appServicePlanEventTypeDetail"u8); @@ -76,15 +75,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -93,22 +92,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebAppServicePlanUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebAppServicePlanUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebAppServicePlanUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebAppServicePlanUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebAppServicePlanUpdatedEventData(document.RootElement, options); } - internal static WebAppServicePlanUpdatedEventData DeserializeWebAppServicePlanUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebAppServicePlanUpdatedEventData DeserializeWebAppServicePlanUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -121,64 +125,62 @@ internal static WebAppServicePlanUpdatedEventData DeserializeWebAppServicePlanUp string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appServicePlanEventTypeDetail"u8)) + if (prop.NameEquals("appServicePlanEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appServicePlanEventTypeDetail = AppServicePlanEventTypeDetail.DeserializeAppServicePlanEventTypeDetail(property.Value, options); + appServicePlanEventTypeDetail = AppServicePlanEventTypeDetail.DeserializeAppServicePlanEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("sku"u8)) + if (prop.NameEquals("sku"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sku = WebAppServicePlanUpdatedEventDataSku.DeserializeWebAppServicePlanUpdatedEventDataSku(property.Value, options); + sku = WebAppServicePlanUpdatedEventDataSku.DeserializeWebAppServicePlanUpdatedEventDataSku(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebAppServicePlanUpdatedEventData( appServicePlanEventTypeDetail, sku, @@ -188,13 +190,16 @@ internal static WebAppServicePlanUpdatedEventData DeserializeWebAppServicePlanUp requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -204,15 +209,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - WebAppServicePlanUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebAppServicePlanUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebAppServicePlanUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebAppServicePlanUpdatedEventData(document.RootElement, options); } default: @@ -220,35 +230,28 @@ WebAppServicePlanUpdatedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebAppServicePlanUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebAppServicePlanUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebAppServicePlanUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebAppServicePlanUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebAppServicePlanUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebAppServicePlanUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppServicePlanUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.cs index 6c0be4ee82e1..2246897d3c76 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event. public partial class WebAppServicePlanUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebAppServicePlanUpdatedEventData() @@ -59,8 +30,8 @@ internal WebAppServicePlanUpdatedEventData() /// The request id generated by the app service for the app service plan API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebAppServicePlanUpdatedEventData(AppServicePlanEventTypeDetail appServicePlanEventTypeDetail, WebAppServicePlanUpdatedEventDataSku sku, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebAppServicePlanUpdatedEventData(AppServicePlanEventTypeDetail appServicePlanEventTypeDetail, WebAppServicePlanUpdatedEventDataSku sku, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppServicePlanEventTypeDetail = appServicePlanEventTypeDetail; Sku = sku; @@ -70,23 +41,30 @@ internal WebAppServicePlanUpdatedEventData(AppServicePlanEventTypeDetail appServ RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app service plan. public AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail { get; } + /// sku of app service plan. public WebAppServicePlanUpdatedEventDataSku Sku { get; } + /// name of the app service plan that had this event. public string Name { get; } + /// The client request id generated by the app service for the app service plan API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the app service plan API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the app service plan API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.Serialization.cs index be929ec22d4a..97ead36cd844 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.Serialization.cs @@ -9,14 +9,14 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class WebAppServicePlanUpdatedEventDataSku : IUtf8JsonSerializable, IJsonModel + /// sku of app service plan. + public partial class WebAppServicePlanUpdatedEventDataSku : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebAppServicePlanUpdatedEventDataSku)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -59,15 +58,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("Capacity"u8); writer.WriteStringValue(Capacity); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -76,22 +75,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebAppServicePlanUpdatedEventDataSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebAppServicePlanUpdatedEventDataSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebAppServicePlanUpdatedEventDataSku JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebAppServicePlanUpdatedEventDataSku)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebAppServicePlanUpdatedEventDataSku(document.RootElement, options); } - internal static WebAppServicePlanUpdatedEventDataSku DeserializeWebAppServicePlanUpdatedEventDataSku(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebAppServicePlanUpdatedEventDataSku DeserializeWebAppServicePlanUpdatedEventDataSku(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -101,54 +105,55 @@ internal static WebAppServicePlanUpdatedEventDataSku DeserializeWebAppServicePla string size = default; string family = default; string capacity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("Tier"u8)) + if (prop.NameEquals("Tier"u8)) { - tier = property.Value.GetString(); + tier = prop.Value.GetString(); continue; } - if (property.NameEquals("Size"u8)) + if (prop.NameEquals("Size"u8)) { - size = property.Value.GetString(); + size = prop.Value.GetString(); continue; } - if (property.NameEquals("Family"u8)) + if (prop.NameEquals("Family"u8)) { - family = property.Value.GetString(); + family = prop.Value.GetString(); continue; } - if (property.NameEquals("Capacity"u8)) + if (prop.NameEquals("Capacity"u8)) { - capacity = property.Value.GetString(); + capacity = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebAppServicePlanUpdatedEventDataSku( name, tier, size, family, capacity, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -158,15 +163,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - WebAppServicePlanUpdatedEventDataSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebAppServicePlanUpdatedEventDataSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebAppServicePlanUpdatedEventDataSku PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebAppServicePlanUpdatedEventDataSku(document.RootElement, options); } default: @@ -174,22 +184,7 @@ WebAppServicePlanUpdatedEventDataSku IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebAppServicePlanUpdatedEventDataSku FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebAppServicePlanUpdatedEventDataSku(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.cs index 775bf2394abd..5db989efee20 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppServicePlanUpdatedEventDataSku.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// sku of app service plan. public partial class WebAppServicePlanUpdatedEventDataSku { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebAppServicePlanUpdatedEventDataSku() @@ -56,25 +27,29 @@ internal WebAppServicePlanUpdatedEventDataSku() /// size of app service plan sku. /// family of app service plan sku. /// capacity of app service plan sku. - /// Keeps track of any properties unknown to the library. - internal WebAppServicePlanUpdatedEventDataSku(string name, string tier, string size, string family, string capacity, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebAppServicePlanUpdatedEventDataSku(string name, string tier, string size, string family, string capacity, IDictionary additionalBinaryDataProperties) { Name = name; Tier = tier; Size = size; Family = family; Capacity = capacity; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// name of app service plan sku. public string Name { get; } + /// tier of app service plan sku. public string Tier { get; } + /// size of app service plan sku. public string Size { get; } + /// family of app service plan sku. public string Family { get; } + /// capacity of app service plan sku. public string Capacity { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.Serialization.cs index 05a3dc548802..9f5d4845511d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event. [JsonConverter(typeof(WebAppUpdatedEventDataConverter))] - public partial class WebAppUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebAppUpdatedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebAppUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebAppUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebAppUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebAppUpdatedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebAppUpdatedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebAppUpdatedEventData(document.RootElement, options); } - internal static WebAppUpdatedEventData DeserializeWebAppUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebAppUpdatedEventData DeserializeWebAppUpdatedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebAppUpdatedEventData DeserializeWebAppUpdatedEventData(JsonEle string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebAppUpdatedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebAppUpdatedEventData DeserializeWebAppUpdatedEventData(JsonEle requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - WebAppUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebAppUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebAppUpdatedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebAppUpdatedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebAppUpdatedEventData IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebAppUpdatedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebAppUpdatedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebAppUpdatedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebAppUpdatedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebAppUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebAppUpdatedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppUpdatedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.cs index 1b4f21220591..9b8a0ef279b4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebAppUpdatedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event. public partial class WebAppUpdatedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebAppUpdatedEventData() @@ -58,8 +29,8 @@ internal WebAppUpdatedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebAppUpdatedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebAppUpdatedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebAppUpdatedEventData(AppEventTypeDetail appEventTypeDetail, string na RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.Serialization.cs index ce8f748cdfd5..9ab04f309993 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event. [JsonConverter(typeof(WebBackupOperationCompletedEventDataConverter))] - public partial class WebBackupOperationCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebBackupOperationCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebBackupOperationCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebBackupOperationCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebBackupOperationCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebBackupOperationCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebBackupOperationCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebBackupOperationCompletedEventData(document.RootElement, options); } - internal static WebBackupOperationCompletedEventData DeserializeWebBackupOperationCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebBackupOperationCompletedEventData DeserializeWebBackupOperationCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebBackupOperationCompletedEventData DeserializeWebBackupOperati string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebBackupOperationCompletedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebBackupOperationCompletedEventData DeserializeWebBackupOperati requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - WebBackupOperationCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebBackupOperationCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebBackupOperationCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebBackupOperationCompletedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebBackupOperationCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebBackupOperationCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebBackupOperationCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebBackupOperationCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebBackupOperationCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebBackupOperationCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebBackupOperationCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebBackupOperationCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.cs index 23422b1f0c54..3a0dca50b30b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event. public partial class WebBackupOperationCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebBackupOperationCompletedEventData() @@ -58,8 +29,8 @@ internal WebBackupOperationCompletedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebBackupOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebBackupOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebBackupOperationCompletedEventData(AppEventTypeDetail appEventTypeDet RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.Serialization.cs index 359fe5f46705..bac1898a7e76 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event. [JsonConverter(typeof(WebBackupOperationFailedEventDataConverter))] - public partial class WebBackupOperationFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebBackupOperationFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebBackupOperationFailedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebBackupOperationFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebBackupOperationFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebBackupOperationFailedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebBackupOperationFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebBackupOperationFailedEventData(document.RootElement, options); } - internal static WebBackupOperationFailedEventData DeserializeWebBackupOperationFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebBackupOperationFailedEventData DeserializeWebBackupOperationFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebBackupOperationFailedEventData DeserializeWebBackupOperationF string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebBackupOperationFailedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebBackupOperationFailedEventData DeserializeWebBackupOperationF requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - WebBackupOperationFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebBackupOperationFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebBackupOperationFailedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebBackupOperationFailedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebBackupOperationFailedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebBackupOperationFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebBackupOperationFailedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebBackupOperationFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebBackupOperationFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebBackupOperationFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebBackupOperationFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebBackupOperationFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.cs index 6e0e7f0b3ebf..842c8e744f1b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationFailedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event. public partial class WebBackupOperationFailedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebBackupOperationFailedEventData() @@ -58,8 +29,8 @@ internal WebBackupOperationFailedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebBackupOperationFailedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebBackupOperationFailedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebBackupOperationFailedEventData(AppEventTypeDetail appEventTypeDetail RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.Serialization.cs index 5b0e88b98264..0313261a8fb5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event. [JsonConverter(typeof(WebBackupOperationStartedEventDataConverter))] - public partial class WebBackupOperationStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebBackupOperationStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebBackupOperationStartedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebBackupOperationStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebBackupOperationStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebBackupOperationStartedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebBackupOperationStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebBackupOperationStartedEventData(document.RootElement, options); } - internal static WebBackupOperationStartedEventData DeserializeWebBackupOperationStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebBackupOperationStartedEventData DeserializeWebBackupOperationStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebBackupOperationStartedEventData DeserializeWebBackupOperation string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebBackupOperationStartedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebBackupOperationStartedEventData DeserializeWebBackupOperation requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - WebBackupOperationStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebBackupOperationStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebBackupOperationStartedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebBackupOperationStartedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebBackupOperationStartedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebBackupOperationStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebBackupOperationStartedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebBackupOperationStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebBackupOperationStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebBackupOperationStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebBackupOperationStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebBackupOperationStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.cs index cb4377262941..c7b99133db9f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebBackupOperationStartedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event. public partial class WebBackupOperationStartedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebBackupOperationStartedEventData() @@ -58,8 +29,8 @@ internal WebBackupOperationStartedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebBackupOperationStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebBackupOperationStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebBackupOperationStartedEventData(AppEventTypeDetail appEventTypeDetai RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.Serialization.cs index 48590d7e35ca..b3a004787da1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event. [JsonConverter(typeof(WebRestoreOperationCompletedEventDataConverter))] - public partial class WebRestoreOperationCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebRestoreOperationCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebRestoreOperationCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebRestoreOperationCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebRestoreOperationCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebRestoreOperationCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebRestoreOperationCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebRestoreOperationCompletedEventData(document.RootElement, options); } - internal static WebRestoreOperationCompletedEventData DeserializeWebRestoreOperationCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebRestoreOperationCompletedEventData DeserializeWebRestoreOperationCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebRestoreOperationCompletedEventData DeserializeWebRestoreOpera string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebRestoreOperationCompletedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebRestoreOperationCompletedEventData DeserializeWebRestoreOpera requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelR } } - WebRestoreOperationCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebRestoreOperationCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebRestoreOperationCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebRestoreOperationCompletedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebRestoreOperationCompletedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebRestoreOperationCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebRestoreOperationCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebRestoreOperationCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebRestoreOperationCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebRestoreOperationCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebRestoreOperationCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebRestoreOperationCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.cs index 225f69b9b434..57bcb9444f6f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event. public partial class WebRestoreOperationCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebRestoreOperationCompletedEventData() @@ -58,8 +29,8 @@ internal WebRestoreOperationCompletedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebRestoreOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebRestoreOperationCompletedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebRestoreOperationCompletedEventData(AppEventTypeDetail appEventTypeDe RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.Serialization.cs index a2ec7b87e5b1..0495484c67f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event. [JsonConverter(typeof(WebRestoreOperationFailedEventDataConverter))] - public partial class WebRestoreOperationFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebRestoreOperationFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebRestoreOperationFailedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebRestoreOperationFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebRestoreOperationFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebRestoreOperationFailedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebRestoreOperationFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebRestoreOperationFailedEventData(document.RootElement, options); } - internal static WebRestoreOperationFailedEventData DeserializeWebRestoreOperationFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebRestoreOperationFailedEventData DeserializeWebRestoreOperationFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebRestoreOperationFailedEventData DeserializeWebRestoreOperatio string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebRestoreOperationFailedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebRestoreOperationFailedEventData DeserializeWebRestoreOperatio requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - WebRestoreOperationFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebRestoreOperationFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebRestoreOperationFailedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebRestoreOperationFailedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebRestoreOperationFailedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebRestoreOperationFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebRestoreOperationFailedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebRestoreOperationFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebRestoreOperationFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebRestoreOperationFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebRestoreOperationFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebRestoreOperationFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.cs index d05833eff15c..b115526dcc5b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationFailedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event. public partial class WebRestoreOperationFailedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebRestoreOperationFailedEventData() @@ -58,8 +29,8 @@ internal WebRestoreOperationFailedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebRestoreOperationFailedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebRestoreOperationFailedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebRestoreOperationFailedEventData(AppEventTypeDetail appEventTypeDetai RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.Serialization.cs index 38de29e162e4..63286d65f51f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event. [JsonConverter(typeof(WebRestoreOperationStartedEventDataConverter))] - public partial class WebRestoreOperationStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebRestoreOperationStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebRestoreOperationStartedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebRestoreOperationStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebRestoreOperationStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebRestoreOperationStartedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebRestoreOperationStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebRestoreOperationStartedEventData(document.RootElement, options); } - internal static WebRestoreOperationStartedEventData DeserializeWebRestoreOperationStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebRestoreOperationStartedEventData DeserializeWebRestoreOperationStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebRestoreOperationStartedEventData DeserializeWebRestoreOperati string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebRestoreOperationStartedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebRestoreOperationStartedEventData DeserializeWebRestoreOperati requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelRea } } - WebRestoreOperationStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebRestoreOperationStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebRestoreOperationStartedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebRestoreOperationStartedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebRestoreOperationStartedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebRestoreOperationStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebRestoreOperationStartedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebRestoreOperationStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebRestoreOperationStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebRestoreOperationStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebRestoreOperationStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebRestoreOperationStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.cs index 39786ed10ceb..b88660309252 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebRestoreOperationStartedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event. public partial class WebRestoreOperationStartedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebRestoreOperationStartedEventData() @@ -58,8 +29,8 @@ internal WebRestoreOperationStartedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebRestoreOperationStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebRestoreOperationStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebRestoreOperationStartedEventData(AppEventTypeDetail appEventTypeDeta RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.Serialization.cs index d15ae1a0049c..1b3afdbe2db0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event. [JsonConverter(typeof(WebSlotSwapCompletedEventDataConverter))] - public partial class WebSlotSwapCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebSlotSwapCompletedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebSlotSwapCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebSlotSwapCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebSlotSwapCompletedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapCompletedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebSlotSwapCompletedEventData(document.RootElement, options); } - internal static WebSlotSwapCompletedEventData DeserializeWebSlotSwapCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebSlotSwapCompletedEventData DeserializeWebSlotSwapCompletedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebSlotSwapCompletedEventData DeserializeWebSlotSwapCompletedEve string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebSlotSwapCompletedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebSlotSwapCompletedEventData DeserializeWebSlotSwapCompletedEve requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - WebSlotSwapCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebSlotSwapCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebSlotSwapCompletedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebSlotSwapCompletedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebSlotSwapCompletedEventData IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebSlotSwapCompletedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebSlotSwapCompletedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebSlotSwapCompletedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebSlotSwapCompletedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebSlotSwapCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebSlotSwapCompletedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapCompletedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.cs index 7a2b3f52162f..fc49baabd7f2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapCompletedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event. public partial class WebSlotSwapCompletedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebSlotSwapCompletedEventData() @@ -58,8 +29,8 @@ internal WebSlotSwapCompletedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebSlotSwapCompletedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebSlotSwapCompletedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebSlotSwapCompletedEventData(AppEventTypeDetail appEventTypeDetail, st RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.Serialization.cs index e9f5c82ea2c2..8ef49785f6c8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event. [JsonConverter(typeof(WebSlotSwapFailedEventDataConverter))] - public partial class WebSlotSwapFailedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebSlotSwapFailedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapFailedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebSlotSwapFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebSlotSwapFailedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebSlotSwapFailedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapFailedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebSlotSwapFailedEventData(document.RootElement, options); } - internal static WebSlotSwapFailedEventData DeserializeWebSlotSwapFailedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebSlotSwapFailedEventData DeserializeWebSlotSwapFailedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebSlotSwapFailedEventData DeserializeWebSlotSwapFailedEventData string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebSlotSwapFailedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebSlotSwapFailedEventData DeserializeWebSlotSwapFailedEventData requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - WebSlotSwapFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebSlotSwapFailedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebSlotSwapFailedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebSlotSwapFailedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebSlotSwapFailedEventData IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebSlotSwapFailedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebSlotSwapFailedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebSlotSwapFailedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebSlotSwapFailedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebSlotSwapFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebSlotSwapFailedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapFailedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.cs index 5f3ae0f1b0f3..6d0b2f60d813 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapFailedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event. public partial class WebSlotSwapFailedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebSlotSwapFailedEventData() @@ -58,8 +29,8 @@ internal WebSlotSwapFailedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebSlotSwapFailedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebSlotSwapFailedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebSlotSwapFailedEventData(AppEventTypeDetail appEventTypeDetail, strin RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.Serialization.cs index f4b563e25eab..53f51bb920de 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event. [JsonConverter(typeof(WebSlotSwapStartedEventDataConverter))] - public partial class WebSlotSwapStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebSlotSwapStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapStartedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebSlotSwapStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebSlotSwapStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebSlotSwapStartedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebSlotSwapStartedEventData(document.RootElement, options); } - internal static WebSlotSwapStartedEventData DeserializeWebSlotSwapStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebSlotSwapStartedEventData DeserializeWebSlotSwapStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebSlotSwapStartedEventData DeserializeWebSlotSwapStartedEventDa string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebSlotSwapStartedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebSlotSwapStartedEventData DeserializeWebSlotSwapStartedEventDa requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - WebSlotSwapStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebSlotSwapStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebSlotSwapStartedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebSlotSwapStartedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebSlotSwapStartedEventData IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebSlotSwapStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebSlotSwapStartedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebSlotSwapStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebSlotSwapStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebSlotSwapStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebSlotSwapStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.cs index 4c5a152e1f56..e1117674a49a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapStartedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event. public partial class WebSlotSwapStartedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebSlotSwapStartedEventData() @@ -58,8 +29,8 @@ internal WebSlotSwapStartedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebSlotSwapStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebSlotSwapStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebSlotSwapStartedEventData(AppEventTypeDetail appEventTypeDetail, stri RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs index d4b69caedef4..2049f18a3ef2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event. [JsonConverter(typeof(WebSlotSwapWithPreviewCancelledEventDataConverter))] - public partial class WebSlotSwapWithPreviewCancelledEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebSlotSwapWithPreviewCancelledEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapWithPreviewCancelledEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebSlotSwapWithPreviewCancelledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebSlotSwapWithPreviewCancelledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebSlotSwapWithPreviewCancelledEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapWithPreviewCancelledEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebSlotSwapWithPreviewCancelledEventData(document.RootElement, options); } - internal static WebSlotSwapWithPreviewCancelledEventData DeserializeWebSlotSwapWithPreviewCancelledEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebSlotSwapWithPreviewCancelledEventData DeserializeWebSlotSwapWithPreviewCancelledEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebSlotSwapWithPreviewCancelledEventData DeserializeWebSlotSwapW string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebSlotSwapWithPreviewCancelledEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebSlotSwapWithPreviewCancelledEventData DeserializeWebSlotSwapW requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(Mod } } - WebSlotSwapWithPreviewCancelledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebSlotSwapWithPreviewCancelledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebSlotSwapWithPreviewCancelledEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebSlotSwapWithPreviewCancelledEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebSlotSwapWithPreviewCancelledEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebSlotSwapWithPreviewCancelledEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebSlotSwapWithPreviewCancelledEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebSlotSwapWithPreviewCancelledEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebSlotSwapWithPreviewCancelledEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebSlotSwapWithPreviewCancelledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebSlotSwapWithPreviewCancelledEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapWithPreviewCancelledEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.cs index 43befb56a825..40e781afbd6a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewCancelledEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event. public partial class WebSlotSwapWithPreviewCancelledEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebSlotSwapWithPreviewCancelledEventData() @@ -58,8 +29,8 @@ internal WebSlotSwapWithPreviewCancelledEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebSlotSwapWithPreviewCancelledEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebSlotSwapWithPreviewCancelledEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebSlotSwapWithPreviewCancelledEventData(AppEventTypeDetail appEventTyp RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.Serialization.cs index ca2af507d422..bb5606d73e68 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.Serialization.cs @@ -10,15 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event. [JsonConverter(typeof(WebSlotSwapWithPreviewStartedEventDataConverter))] - public partial class WebSlotSwapWithPreviewStartedEventData : IUtf8JsonSerializable, IJsonModel + public partial class WebSlotSwapWithPreviewStartedEventData : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapWithPreviewStartedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AppEventTypeDetail)) { writer.WritePropertyName("appEventTypeDetail"u8); @@ -71,15 +70,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("verb"u8); writer.WriteStringValue(Verb); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -88,22 +87,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebSlotSwapWithPreviewStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebSlotSwapWithPreviewStartedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebSlotSwapWithPreviewStartedEventData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebSlotSwapWithPreviewStartedEventData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebSlotSwapWithPreviewStartedEventData(document.RootElement, options); } - internal static WebSlotSwapWithPreviewStartedEventData DeserializeWebSlotSwapWithPreviewStartedEventData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebSlotSwapWithPreviewStartedEventData DeserializeWebSlotSwapWithPreviewStartedEventData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -115,55 +119,53 @@ internal static WebSlotSwapWithPreviewStartedEventData DeserializeWebSlotSwapWit string requestId = default; string address = default; string verb = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("appEventTypeDetail"u8)) + if (prop.NameEquals("appEventTypeDetail"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(property.Value, options); + appEventTypeDetail = AppEventTypeDetail.DeserializeAppEventTypeDetail(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("clientRequestId"u8)) + if (prop.NameEquals("clientRequestId"u8)) { - clientRequestId = property.Value.GetString(); + clientRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("correlationRequestId"u8)) + if (prop.NameEquals("correlationRequestId"u8)) { - correlationRequestId = property.Value.GetString(); + correlationRequestId = prop.Value.GetString(); continue; } - if (property.NameEquals("requestId"u8)) + if (prop.NameEquals("requestId"u8)) { - requestId = property.Value.GetString(); + requestId = prop.Value.GetString(); continue; } - if (property.NameEquals("address"u8)) + if (prop.NameEquals("address"u8)) { - address = property.Value.GetString(); + address = prop.Value.GetString(); continue; } - if (property.NameEquals("verb"u8)) + if (prop.NameEquals("verb"u8)) { - verb = property.Value.GetString(); + verb = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new WebSlotSwapWithPreviewStartedEventData( appEventTypeDetail, name, @@ -172,13 +174,16 @@ internal static WebSlotSwapWithPreviewStartedEventData DeserializeWebSlotSwapWit requestId, address, verb, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -188,15 +193,20 @@ BinaryData IPersistableModel.Write(Model } } - WebSlotSwapWithPreviewStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebSlotSwapWithPreviewStartedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebSlotSwapWithPreviewStartedEventData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebSlotSwapWithPreviewStartedEventData(document.RootElement, options); } default: @@ -204,35 +214,28 @@ WebSlotSwapWithPreviewStartedEventData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static WebSlotSwapWithPreviewStartedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeWebSlotSwapWithPreviewStartedEventData(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - internal partial class WebSlotSwapWithPreviewStartedEventDataConverter : JsonConverter { + /// Writes the JSON representation of the model. + /// The writer. + /// The model to write. + /// The serialization options. public override void Write(Utf8JsonWriter writer, WebSlotSwapWithPreviewStartedEventData model, JsonSerializerOptions options) { - writer.WriteObjectValue(model, ModelSerializationExtensions.WireOptions); + writer.WriteObjectValue>(model, ModelSerializationExtensions.WireOptions); } + /// Reads the JSON representation and converts into the model. + /// The reader. + /// The type to convert. + /// The serialization options. public override WebSlotSwapWithPreviewStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - using var document = JsonDocument.ParseValue(ref reader); - return DeserializeWebSlotSwapWithPreviewStartedEventData(document.RootElement); + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapWithPreviewStartedEventData(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.cs index d45ecb40ad09..1100c796e206 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/WebSlotSwapWithPreviewStartedEventData.cs @@ -13,37 +13,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event. public partial class WebSlotSwapWithPreviewStartedEventData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebSlotSwapWithPreviewStartedEventData() @@ -58,8 +29,8 @@ internal WebSlotSwapWithPreviewStartedEventData() /// The request id generated by the app service for the site API operation that triggered this event. /// HTTP request URL of this operation. /// HTTP verb of this operation. - /// Keeps track of any properties unknown to the library. - internal WebSlotSwapWithPreviewStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebSlotSwapWithPreviewStartedEventData(AppEventTypeDetail appEventTypeDetail, string name, string clientRequestId, string correlationRequestId, string requestId, string address, string verb, IDictionary additionalBinaryDataProperties) { AppEventTypeDetail = appEventTypeDetail; Name = name; @@ -68,21 +39,27 @@ internal WebSlotSwapWithPreviewStartedEventData(AppEventTypeDetail appEventTypeD RequestId = requestId; Address = address; Verb = verb; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Detail of action on the app. public AppEventTypeDetail AppEventTypeDetail { get; } + /// name of the web site that had this event. public string Name { get; } + /// The client request id generated by the app service for the site API operation that triggered this event. public string ClientRequestId { get; } + /// The correlation request id generated by the app service for the site API operation that triggered this event. public string CorrelationRequestId { get; } + /// The request id generated by the app service for the site API operation that triggered this event. public string RequestId { get; } + /// HTTP request URL of this operation. public string Address { get; } + /// HTTP verb of this operation. public string Verb { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml index 69339bffa05a..d6c7f3d41404 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml @@ -1,3 +1,4 @@ repo: Azure/azure-rest-api-specs directory: "specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents" -commit: 0d9b37fb6d65b0ff7efc208d96d80789e7845481 +commit: 4c09d8bbeea862f6a84a75f703c3a30ed48fc5cc +emitterPackageJsonPath: eng/azure-typespec-http-client-csharp-emitter-package.json From 2d1b7fcdfa98a1213742327498ba8ef8a2cf00fc Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 11 Aug 2025 12:53:48 -0700 Subject: [PATCH 2/7] update commit --- .../Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml index d6c7f3d41404..bff06a79f7f7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml @@ -1,4 +1,4 @@ repo: Azure/azure-rest-api-specs directory: "specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents" -commit: 4c09d8bbeea862f6a84a75f703c3a30ed48fc5cc +commit: 752dade436619ed28bd03ca2e77cfa5acf6222dd emitterPackageJsonPath: eng/azure-typespec-http-client-csharp-emitter-package.json From 7158baf50dc164eebeb0491d777a77f99a637e2e Mon Sep 17 00:00:00 2001 From: jolov Date: Mon, 11 Aug 2025 16:14:49 -0700 Subject: [PATCH 3/7] regen --- ...ReceivedInThreadEventData.Serialization.cs | 4 +- ...zureBotCommandReceivedInThreadEventData.cs | 4 +- ...hatMessageEditedEventData.Serialization.cs | 4 +- .../AcsChatMessageEditedEventData.cs | 4 +- ...geEditedInThreadEventData.Serialization.cs | 4 +- .../AcsChatMessageEditedInThreadEventData.cs | 4 +- ...tMessageReceivedEventData.Serialization.cs | 4 +- .../AcsChatMessageReceivedEventData.cs | 4 +- ...ReceivedInThreadEventData.Serialization.cs | 4 +- ...AcsChatMessageReceivedInThreadEventData.cs | 4 +- ...hatThreadCreatedEventData.Serialization.cs | 4 +- .../AcsChatThreadCreatedEventData.cs | 4 +- ...dCreatedWithUserEventData.Serialization.cs | 4 +- .../AcsChatThreadCreatedWithUserEventData.cs | 4 +- ...readParticipantProperties.Serialization.cs | 4 +- .../AcsChatThreadParticipantProperties.cs | 4 +- ...ropertiesUpdatedEventData.Serialization.cs | 23 +++-- ...AcsChatThreadPropertiesUpdatedEventData.cs | 9 +- ...esUpdatedPerUserEventData.Serialization.cs | 4 +- ...ThreadPropertiesUpdatedPerUserEventData.cs | 4 +- ...ReceivedInThreadEventData.Serialization.cs | 4 +- ...ypingIndicatorReceivedInThreadEventData.cs | 4 +- ...IncomingCallCustomContext.Serialization.cs | 51 +++++----- .../Generated/AcsIncomingCallCustomContext.cs | 14 ++- ...uterJobCancelledEventData.Serialization.cs | 5 - .../AcsRouterJobCancelledEventData.cs | 4 +- ...sificationFailedEventData.Serialization.cs | 5 - ...sRouterJobClassificationFailedEventData.cs | 4 +- .../AcsRouterJobClassifiedEventData.cs | 4 +- ...sRouterJobClosedEventData.Serialization.cs | 5 - .../Generated/AcsRouterJobClosedEventData.cs | 4 +- ...uterJobCompletedEventData.Serialization.cs | 5 - .../AcsRouterJobCompletedEventData.cs | 4 +- ...RouterJobDeletedEventData.Serialization.cs | 5 - .../Generated/AcsRouterJobDeletedEventData.cs | 4 +- .../AcsRouterJobEventData.Serialization.cs | 47 ++++----- .../src/Generated/AcsRouterJobEventData.cs | 8 +- ...ceptionTriggeredEventData.Serialization.cs | 5 - ...AcsRouterJobExceptionTriggeredEventData.cs | 4 +- ...sRouterJobQueuedEventData.Serialization.cs | 5 - .../Generated/AcsRouterJobQueuedEventData.cs | 4 +- .../AcsRouterJobReceivedEventData.cs | 4 +- ...SchedulingFailedEventData.Serialization.cs | 5 - .../AcsRouterJobSchedulingFailedEventData.cs | 4 +- ...terJobUnassignedEventData.Serialization.cs | 5 - .../AcsRouterJobUnassignedEventData.cs | 4 +- ...sRouterJobWaitingForActivationEventData.cs | 4 +- ...SelectorsExpiredEventData.Serialization.cs | 5 - ...outerJobWorkerSelectorsExpiredEventData.cs | 4 +- .../AcsRouterQueueDetails.Serialization.cs | 28 +++--- .../src/Generated/AcsRouterQueueDetails.cs | 9 +- ...kerOfferAcceptedEventData.Serialization.cs | 97 ++++++++++--------- .../AcsRouterWorkerOfferAcceptedEventData.cs | 24 ++--- ...orkerOfferIssuedEventData.Serialization.cs | 97 ++++++++++--------- .../AcsRouterWorkerOfferIssuedEventData.cs | 24 ++--- ...WorkerRegisteredEventData.Serialization.cs | 51 +++++----- .../AcsRouterWorkerRegisteredEventData.cs | 14 ++- ...terWorkerUpdatedEventData.Serialization.cs | 51 +++++----- .../AcsRouterWorkerUpdatedEventData.cs | 14 ++- ...xecutionFinishedEventData.Serialization.cs | 23 +++-- .../AvsScriptExecutionFinishedEventData.cs | 9 +- ...eTelemetryEventProperties.Serialization.cs | 46 +++++---- .../DeviceTelemetryEventProperties.cs | 14 ++- .../src/Generated/EventGridModelFactory.cs | 88 ++++++++--------- ...CreatedOrUpdatedEventData.Serialization.cs | 23 +++-- ...GridMqttClientCreatedOrUpdatedEventData.cs | 17 ++-- ...bDeviceTelemetryEventData.Serialization.cs | 4 +- .../IotHubDeviceTelemetryEventData.cs | 6 +- ...reMessagingEventGridSystemEventsContext.cs | 6 +- ...urceActionCancelEventData.Serialization.cs | 7 +- .../ResourceActionCancelEventData.cs | 4 +- ...rceActionFailureEventData.Serialization.cs | 7 +- .../ResourceActionFailureEventData.cs | 4 +- ...rceActionSuccessEventData.Serialization.cs | 7 +- .../ResourceActionSuccessEventData.cs | 4 +- .../ResourceAuthorization.Serialization.cs | 28 +++--- .../src/Generated/ResourceAuthorization.cs | 9 +- ...urceDeleteCancelEventData.Serialization.cs | 7 +- .../ResourceDeleteCancelEventData.cs | 4 +- ...rceDeleteFailureEventData.Serialization.cs | 7 +- .../ResourceDeleteFailureEventData.cs | 4 +- ...rceDeleteSuccessEventData.Serialization.cs | 7 +- .../ResourceDeleteSuccessEventData.cs | 4 +- ...onsResourceUpdatedDetails.Serialization.cs | 4 +- ...ourceWriteCancelEventData.Serialization.cs | 7 +- .../Generated/ResourceWriteCancelEventData.cs | 4 +- ...urceWriteFailureEventData.Serialization.cs | 7 +- .../ResourceWriteFailureEventData.cs | 4 +- ...urceWriteSuccessEventData.Serialization.cs | 7 +- .../ResourceWriteSuccessEventData.cs | 4 +- 90 files changed, 528 insertions(+), 591 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs index 0c97a1eef395..9adb3e18e91c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.Serialization.cs @@ -43,7 +43,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -96,7 +96,7 @@ internal static AcsChatAzureBotCommandReceivedInThreadEventData DeserializeAcsCh string @type = default; long? version = default; string messageBody = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("transactionId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs index 9f280b42d39e..ec67a67eb0b4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatAzureBotCommandReceivedInThreadEventData.cs @@ -37,7 +37,7 @@ internal AcsChatAzureBotCommandReceivedInThreadEventData(string threadId, string /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) + internal AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; @@ -47,6 +47,6 @@ internal AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId, s public string MessageBody { get; } /// The chat message metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs index ece42e67b99f..fe757ca40ca4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs @@ -43,7 +43,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -102,7 +102,7 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve string @type = default; long? version = default; string messageBody = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; DateTimeOffset? editTime = default; foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs index d4a47cead0f5..76c2f381117c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs @@ -40,7 +40,7 @@ internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCom /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; @@ -51,7 +51,7 @@ internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCom public string MessageBody { get; } /// The chat message metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. public DateTimeOffset? EditTime { get; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs index 34844b6d4d16..71afa92f8975 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs @@ -43,7 +43,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -101,7 +101,7 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE string @type = default; long? version = default; string messageBody = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; DateTimeOffset? editTime = default; foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs index e67e7490787e..372c4f46c3f9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs @@ -38,7 +38,7 @@ internal AcsChatMessageEditedInThreadEventData(string threadId, string messageId /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata, DateTimeOffset? editTime) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) + internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; @@ -49,7 +49,7 @@ internal AcsChatMessageEditedInThreadEventData(string transactionId, string thre public string MessageBody { get; } /// The chat message metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. public DateTimeOffset? EditTime { get; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs index 031b2edaaaf0..6d14ab5d9d2e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs @@ -43,7 +43,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -97,7 +97,7 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive string @type = default; long? version = default; string messageBody = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("recipientCommunicationIdentifier"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs index 5c76f3a7d17a..aeac8c10ee72 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs @@ -39,7 +39,7 @@ internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientC /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; @@ -49,6 +49,6 @@ internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientC public string MessageBody { get; } /// The chat message metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs index fd045850e4cc..caf8ae5ffd8d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs @@ -43,7 +43,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -96,7 +96,7 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag string @type = default; long? version = default; string messageBody = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("transactionId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs index 2e13caac76d4..3a47ea333c67 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs @@ -37,7 +37,7 @@ internal AcsChatMessageReceivedInThreadEventData(string threadId, string message /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) + internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; @@ -47,6 +47,6 @@ internal AcsChatMessageReceivedInThreadEventData(string transactionId, string th public string MessageBody { get; } /// The chat message metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs index 6acfc580a3d6..196e4365f41f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs @@ -56,7 +56,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item.Value, options); } writer.WriteEndObject(); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -116,7 +116,7 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve long? version = default; CommunicationIdentifierModel createdByCommunicationIdentifier = default; IReadOnlyDictionary properties = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs index 04a6f5e23a1e..15c05559d339 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs @@ -35,7 +35,7 @@ internal AcsChatThreadCreatedEventData(string threadId, CommunicationIdentifierM /// Gets the properties of the chat thread created event. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) + internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; @@ -47,7 +47,7 @@ internal AcsChatThreadCreatedEventData(string transactionId, string threadId, ID public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } /// The thread metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } /// The list of properties of participants who are part of the thread. public IReadOnlyList Participants { get; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs index 44366ad272e2..2aaebb1e46d2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs @@ -56,7 +56,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item.Value, options); } writer.WriteEndObject(); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -117,7 +117,7 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr long? version = default; CommunicationIdentifierModel createdByCommunicationIdentifier = default; IReadOnlyDictionary properties = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs index 4007890cdf8b..e0ffbe3bf9cc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs @@ -37,7 +37,7 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci /// Gets the properties of the chat thread created with user event. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; @@ -49,7 +49,7 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } /// The thread metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } /// The list of properties of participants who are part of the thread. public IReadOnlyList Participants { get; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs index fc06f2862365..b98078762489 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.Serialization.cs @@ -45,7 +45,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("participantCommunicationIdentifier"u8); writer.WriteObjectValue(ParticipantCommunicationIdentifier, options); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -105,7 +105,7 @@ internal static AcsChatThreadParticipantProperties DeserializeAcsChatThreadParti } string displayName = default; CommunicationIdentifierModel participantCommunicationIdentifier = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs index b1f8a4d99350..ef39f7b6a55b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadParticipantProperties.cs @@ -29,7 +29,7 @@ internal AcsChatThreadParticipantProperties(CommunicationIdentifierModel partici /// The communication identifier of the user. /// The metadata of the user. /// Keeps track of any properties unknown to the library. - internal AcsChatThreadParticipantProperties(string displayName, CommunicationIdentifierModel participantCommunicationIdentifier, IDictionary metadata, IDictionary additionalBinaryDataProperties) + internal AcsChatThreadParticipantProperties(string displayName, CommunicationIdentifierModel participantCommunicationIdentifier, IReadOnlyDictionary metadata, IDictionary additionalBinaryDataProperties) { DisplayName = displayName; ParticipantCommunicationIdentifier = participantCommunicationIdentifier; @@ -44,6 +44,6 @@ internal AcsChatThreadParticipantProperties(string displayName, CommunicationIde public CommunicationIdentifierModel ParticipantCommunicationIdentifier { get; } /// The metadata of the user. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs index 3a1c6a561da1..6b47914ad36a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs @@ -61,19 +61,22 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item.Value, options); } writer.WriteEndObject(); - writer.WritePropertyName("metadata"u8); - writer.WriteStartObject(); - foreach (var item in Metadata) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); } /// The JSON reader. @@ -109,7 +112,7 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread CommunicationIdentifierModel editedByCommunicationIdentifier = default; DateTimeOffset? editTime = default; IReadOnlyDictionary properties = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("transactionId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs index 143e2718670f..f36518640330 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs @@ -17,12 +17,11 @@ public partial class AcsChatThreadPropertiesUpdatedEventData : AcsChatThreadEven /// The chat thread id. /// The communication identifier of the user who updated the thread properties. /// Gets the properties of the chat thread updated event. - /// The thread metadata. - internal AcsChatThreadPropertiesUpdatedEventData(string threadId, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties, IDictionary metadata) : base(threadId) + internal AcsChatThreadPropertiesUpdatedEventData(string threadId, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties) : base(threadId) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; Properties = properties; - Metadata = metadata; + Metadata = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -35,7 +34,7 @@ internal AcsChatThreadPropertiesUpdatedEventData(string threadId, CommunicationI /// The time at which the properties of the thread were updated. /// Gets the properties of the chat thread updated event. /// The thread metadata. - internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) + internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -50,6 +49,6 @@ internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string th public DateTimeOffset? EditTime { get; } /// The thread metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs index 61c6a20a4b71..7d24cb14797c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs @@ -48,7 +48,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("editTime"u8); writer.WriteStringValue(EditTime.Value, "O"); } - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -112,7 +112,7 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha long? version = default; CommunicationIdentifierModel editedByCommunicationIdentifier = default; DateTimeOffset? editTime = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; IReadOnlyDictionary properties = default; foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs index 20b5a38f1b2a..97c75a27eb63 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -36,7 +36,7 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM /// The time at which the properties of the thread were updated. /// The thread metadata. /// The properties of the chat thread that were updated for the user. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary additionalBinaryDataProperties, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -51,6 +51,6 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM public DateTimeOffset? EditTime { get; } /// The thread metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs index 54996d0b2a7b..76f97daee488 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.Serialization.cs @@ -43,7 +43,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("messageBody"u8); writer.WriteStringValue(MessageBody); - if (Optional.IsCollectionDefined(Metadata)) + if (options.Format != "W" && Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); @@ -96,7 +96,7 @@ internal static AcsChatTypingIndicatorReceivedInThreadEventData DeserializeAcsCh string @type = default; long? version = default; string messageBody = default; - IDictionary metadata = default; + IReadOnlyDictionary metadata = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("transactionId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs index 518b3ebc07ed..7827e4016ea9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatTypingIndicatorReceivedInThreadEventData.cs @@ -37,7 +37,7 @@ internal AcsChatTypingIndicatorReceivedInThreadEventData(string threadId, string /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) + internal AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId, string threadId, IDictionary additionalBinaryDataProperties, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string @type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, additionalBinaryDataProperties, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, @type, version) { MessageBody = messageBody; Metadata = metadata; @@ -47,6 +47,6 @@ internal AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId, s public string MessageBody { get; } /// The chat message metadata. - public IDictionary Metadata { get; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs index f909868c720b..2730a81b4c5f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.Serialization.cs @@ -15,11 +15,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Custom Context of Incoming Call. public partial class AcsIncomingCallCustomContext : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsIncomingCallCustomContext() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -38,32 +33,38 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { throw new FormatException($"The model {nameof(AcsIncomingCallCustomContext)} does not support writing '{format}' format."); } - writer.WritePropertyName("sipHeaders"u8); - writer.WriteStartObject(); - foreach (var item in SipHeaders) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("sipHeaders"u8); + writer.WriteStartObject(); + foreach (var item in SipHeaders) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("voipHeaders"u8); - writer.WriteStartObject(); - foreach (var item in VoipHeaders) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("voipHeaders"u8); + writer.WriteStartObject(); + foreach (var item in VoipHeaders) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _additionalBinaryDataProperties != null) { foreach (var item in _additionalBinaryDataProperties) @@ -106,8 +107,8 @@ internal static AcsIncomingCallCustomContext DeserializeAcsIncomingCallCustomCon { return null; } - IDictionary sipHeaders = default; - IDictionary voipHeaders = default; + IReadOnlyDictionary sipHeaders = default; + IReadOnlyDictionary voipHeaders = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs index a23c81229555..59a387ee23ab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallCustomContext.cs @@ -17,19 +17,17 @@ public partial class AcsIncomingCallCustomContext private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// Sip Headers for incoming call. - /// Voip Headers for incoming call. - internal AcsIncomingCallCustomContext(IDictionary sipHeaders, IDictionary voipHeaders) + internal AcsIncomingCallCustomContext() { - SipHeaders = sipHeaders; - VoipHeaders = voipHeaders; + SipHeaders = new ChangeTrackingDictionary(); + VoipHeaders = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Sip Headers for incoming call. /// Voip Headers for incoming call. /// Keeps track of any properties unknown to the library. - internal AcsIncomingCallCustomContext(IDictionary sipHeaders, IDictionary voipHeaders, IDictionary additionalBinaryDataProperties) + internal AcsIncomingCallCustomContext(IReadOnlyDictionary sipHeaders, IReadOnlyDictionary voipHeaders, IDictionary additionalBinaryDataProperties) { SipHeaders = sipHeaders; VoipHeaders = voipHeaders; @@ -37,9 +35,9 @@ internal AcsIncomingCallCustomContext(IDictionary sipHeaders, ID } /// Sip Headers for incoming call. - public IDictionary SipHeaders { get; } + public IReadOnlyDictionary SipHeaders { get; } /// Voip Headers for incoming call. - public IDictionary VoipHeaders { get; } + public IReadOnlyDictionary VoipHeaders { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs index e6d081603f8c..54df791df9b0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobCancelledEventDataConverter))] public partial class AcsRouterJobCancelledEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobCancelledEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs index dc5be28ad9c0..c885d19dd9df 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCancelledEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobCancelledEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobCancelledEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobCancelledEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs index e4cd8e5776eb..f955d7b84340 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobClassificationFailedEventDataConverter))] public partial class AcsRouterJobClassificationFailedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobClassificationFailedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs index 42722b36aa79..e964d0669b41 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassificationFailedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobClassificationFailedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobClassificationFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobClassificationFailedEventData() { ErrorsInternal = new ChangeTrackingList(); } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs index 31e490559c6f..e16ece3ec39b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClassifiedEventData.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobClassifiedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. /// Router Job Queue Info. - internal AcsRouterJobClassifiedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterQueueDetails queueDetails) : base(labels, tags) + internal AcsRouterJobClassifiedEventData(AcsRouterQueueDetails queueDetails) { QueueDetails = queueDetails; AttachedWorkerSelectors = new ChangeTrackingList(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs index be3649f3670d..9e31773a8cdf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobClosedEventDataConverter))] public partial class AcsRouterJobClosedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobClosedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs index 3b5881dbdf50..347f58c19b8c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobClosedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobClosedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobClosedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobClosedEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs index 06339c9d06ff..936f1b49378e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobCompletedEventDataConverter))] public partial class AcsRouterJobCompletedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobCompletedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs index 17471c7f5c52..313a3cabc9ec 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobCompletedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobCompletedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobCompletedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobCompletedEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs index a70841e3290b..c668abd30b58 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobDeletedEventDataConverter))] public partial class AcsRouterJobDeletedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobDeletedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs index ddaacb715407..8024efd46370 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobDeletedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobDeletedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobDeletedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobDeletedEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs index db2fc85feb70..44fa9cabe122 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobEventDataConverter))] public partial class AcsRouterJobEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -46,32 +41,38 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("queueId"u8); writer.WriteStringValue(QueueId); } - writer.WritePropertyName("labels"u8); - writer.WriteStartObject(); - foreach (var item in Labels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("labels"u8); + writer.WriteStartObject(); + foreach (var item in Labels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); } /// The JSON reader. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs index 99c0cb081452..0944e5cfe113 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobEventData.cs @@ -14,12 +14,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobEventData : AcsRouterEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) + internal AcsRouterJobEventData() { - Labels = labels; - Tags = tags; + Labels = new ChangeTrackingDictionary(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs index f6da44e15112..64a54f18d909 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobExceptionTriggeredEventDataConverter))] public partial class AcsRouterJobExceptionTriggeredEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobExceptionTriggeredEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs index 4a8b5bdd1e6f..f2791239424c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobExceptionTriggeredEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobExceptionTriggeredEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobExceptionTriggeredEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobExceptionTriggeredEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs index 2b53e685597c..372f4b9d339a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobQueuedEventDataConverter))] public partial class AcsRouterJobQueuedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobQueuedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs index 06d410262b96..05abdc0e555f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobQueuedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobQueuedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobQueuedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobQueuedEventData() { AttachedWorkerSelectors = new ChangeTrackingList(); RequestedWorkerSelectors = new ChangeTrackingList(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs index 7d156c6ce217..bf01c1fa9d5d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobReceivedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. /// Unavailable For Matching for Router Job Received. - internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobReceivedEventData(bool unavailableForMatching) { RequestedWorkerSelectors = new ChangeTrackingList(); UnavailableForMatching = unavailableForMatching; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs index 9a5ad660871d..0ed1b70ff2cb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobSchedulingFailedEventDataConverter))] public partial class AcsRouterJobSchedulingFailedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobSchedulingFailedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs index 07aa96441146..1bde6fe62847 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobSchedulingFailedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobSchedulingFailedEventData() { ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs index 38d3c77ab767..d2eacc16b467 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobUnassignedEventDataConverter))] public partial class AcsRouterJobUnassignedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobUnassignedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs index 31112920a51c..13af4aa2fc13 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobUnassignedEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobUnassignedEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobUnassignedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobUnassignedEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs index ea81ca47ad07..0106c6615ac2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobWaitingForActivationEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. /// Router Job Waiting For Activation Unavailable For Matching. - internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobWaitingForActivationEventData(bool unavailableForMatching) { ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs index 0c21724c94f5..35c8b820a3d2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterJobWorkerSelectorsExpiredEventDataConverter))] public partial class AcsRouterJobWorkerSelectorsExpiredEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterJobWorkerSelectorsExpiredEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs index c462761fa209..1338bfcf405f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWorkerSelectorsExpiredEventData.cs @@ -14,9 +14,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterJobWorkerSelectorsExpiredEventData : AcsRouterJobEventData { /// Initializes a new instance of . - /// Router Job events Labels. - /// Router Jobs events Tags. - internal AcsRouterJobWorkerSelectorsExpiredEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(labels, tags) + internal AcsRouterJobWorkerSelectorsExpiredEventData() { ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs index 79bd4466d0bf..1d7175c187d1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.Serialization.cs @@ -15,11 +15,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Router Queue Details. public partial class AcsRouterQueueDetails : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterQueueDetails() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -48,19 +43,22 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - writer.WritePropertyName("labels"u8); - writer.WriteStartObject(); - foreach (var item in Labels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("labels"u8); + writer.WriteStartObject(); + foreach (var item in Labels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _additionalBinaryDataProperties != null) { foreach (var item in _additionalBinaryDataProperties) @@ -105,7 +103,7 @@ internal static AcsRouterQueueDetails DeserializeAcsRouterQueueDetails(JsonEleme } string id = default; string name = default; - IDictionary labels = default; + IReadOnlyDictionary labels = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs index 2aa15c4f903a..be14793fbc40 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterQueueDetails.cs @@ -17,10 +17,9 @@ public partial class AcsRouterQueueDetails private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// Router Queue Labels. - internal AcsRouterQueueDetails(IDictionary labels) + internal AcsRouterQueueDetails() { - Labels = labels; + Labels = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -28,7 +27,7 @@ internal AcsRouterQueueDetails(IDictionary labels) /// Router Queue Name. /// Router Queue Labels. /// Keeps track of any properties unknown to the library. - internal AcsRouterQueueDetails(string id, string name, IDictionary labels, IDictionary additionalBinaryDataProperties) + internal AcsRouterQueueDetails(string id, string name, IReadOnlyDictionary labels, IDictionary additionalBinaryDataProperties) { Id = id; Name = name; @@ -43,6 +42,6 @@ internal AcsRouterQueueDetails(string id, string name, IDictionary Router Queue Labels. - public IDictionary Labels { get; } + public IReadOnlyDictionary Labels { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs index b727d93aca03..79972dcb1416 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterWorkerOfferAcceptedEventDataConverter))] public partial class AcsRouterWorkerOfferAcceptedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerOfferAcceptedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -61,58 +56,70 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("jobPriority"u8); writer.WriteNumberValue(JobPriority.Value); } - writer.WritePropertyName("workerLabels"u8); - writer.WriteStartObject(); - foreach (var item in WorkerLabels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("workerLabels"u8); + writer.WriteStartObject(); + foreach (var item in WorkerLabels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("workerTags"u8); - writer.WriteStartObject(); - foreach (var item in WorkerTags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("workerTags"u8); + writer.WriteStartObject(); + foreach (var item in WorkerTags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("jobLabels"u8); - writer.WriteStartObject(); - foreach (var item in JobLabels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("jobLabels"u8); + writer.WriteStartObject(); + foreach (var item in JobLabels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("jobTags"u8); - writer.WriteStartObject(); - foreach (var item in JobTags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("jobTags"u8); + writer.WriteStartObject(); + foreach (var item in JobTags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); } /// The JSON reader. @@ -149,10 +156,10 @@ internal static AcsRouterWorkerOfferAcceptedEventData DeserializeAcsRouterWorker string offerId = default; string assignmentId = default; int? jobPriority = default; - IDictionary workerLabels = default; - IDictionary workerTags = default; - IDictionary jobLabels = default; - IDictionary jobTags = default; + IReadOnlyDictionary workerLabels = default; + IReadOnlyDictionary workerTags = default; + IReadOnlyDictionary jobLabels = default; + IReadOnlyDictionary jobTags = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("jobId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs index a5e18110bfc9..7cf720821935 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferAcceptedEventData.cs @@ -14,16 +14,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterWorkerOfferAcceptedEventData : AcsRouterWorkerEventData { /// Initializes a new instance of . - /// Router Worker Offer Accepted Worker Labels. - /// Router Worker Offer Accepted Worker Tags. - /// Router Worker Offer Accepted Job Labels. - /// Router Worker Offer Accepted Job Tags. - internal AcsRouterWorkerOfferAcceptedEventData(IDictionary workerLabels, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) + internal AcsRouterWorkerOfferAcceptedEventData() { - WorkerLabels = workerLabels; - WorkerTags = workerTags; - JobLabels = jobLabels; - JobTags = jobTags; + WorkerLabels = new ChangeTrackingDictionary(); + WorkerTags = new ChangeTrackingDictionary(); + JobLabels = new ChangeTrackingDictionary(); + JobTags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -40,7 +36,7 @@ internal AcsRouterWorkerOfferAcceptedEventData(IDictionary worke /// Router Worker Offer Accepted Worker Tags. /// Router Worker Offer Accepted Job Labels. /// Router Worker Offer Accepted Job Tags. - internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId, string assignmentId, int? jobPriority, IDictionary workerLabels, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) + internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId, string assignmentId, int? jobPriority, IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -65,15 +61,15 @@ internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelRefer public int? JobPriority { get; } /// Router Worker Offer Accepted Worker Labels. - public IDictionary WorkerLabels { get; } + public IReadOnlyDictionary WorkerLabels { get; } /// Router Worker Offer Accepted Worker Tags. - public IDictionary WorkerTags { get; } + public IReadOnlyDictionary WorkerTags { get; } /// Router Worker Offer Accepted Job Labels. - public IDictionary JobLabels { get; } + public IReadOnlyDictionary JobLabels { get; } /// Router Worker Offer Accepted Job Tags. - public IDictionary JobTags { get; } + public IReadOnlyDictionary JobTags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs index 03d71e65a27c..4bdb6d8c38d4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterWorkerOfferIssuedEventDataConverter))] public partial class AcsRouterWorkerOfferIssuedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerOfferIssuedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -56,19 +51,22 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("jobPriority"u8); writer.WriteNumberValue(JobPriority.Value); } - writer.WritePropertyName("workerLabels"u8); - writer.WriteStartObject(); - foreach (var item in WorkerLabels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("workerLabels"u8); + writer.WriteStartObject(); + foreach (var item in WorkerLabels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (Optional.IsDefined(OfferedOn)) { writer.WritePropertyName("offeredOn"u8); @@ -79,45 +77,54 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("expiresOn"u8); writer.WriteStringValue(ExpiresOn.Value, "O"); } - writer.WritePropertyName("workerTags"u8); - writer.WriteStartObject(); - foreach (var item in WorkerTags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("workerTags"u8); + writer.WriteStartObject(); + foreach (var item in WorkerTags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("jobLabels"u8); - writer.WriteStartObject(); - foreach (var item in JobLabels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("jobLabels"u8); + writer.WriteStartObject(); + foreach (var item in JobLabels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("jobTags"u8); - writer.WriteStartObject(); - foreach (var item in JobTags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("jobTags"u8); + writer.WriteStartObject(); + foreach (var item in JobTags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); } /// The JSON reader. @@ -153,12 +160,12 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf string queueId = default; string offerId = default; int? jobPriority = default; - IDictionary workerLabels = default; + IReadOnlyDictionary workerLabels = default; DateTimeOffset? offeredOn = default; DateTimeOffset? expiresOn = default; - IDictionary workerTags = default; - IDictionary jobLabels = default; - IDictionary jobTags = default; + IReadOnlyDictionary workerTags = default; + IReadOnlyDictionary jobLabels = default; + IReadOnlyDictionary jobTags = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("jobId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs index b9e6f0821c1c..72fdd0c74f19 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs @@ -14,16 +14,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsRouterWorkerOfferIssuedEventData : AcsRouterWorkerEventData { /// Initializes a new instance of . - /// Router Worker Offer Issued Worker Labels. - /// Router Worker Offer Issued Worker Tags. - /// Router Worker Offer Issued Job Labels. - /// Router Worker Offer Issued Job Tags. - internal AcsRouterWorkerOfferIssuedEventData(IDictionary workerLabels, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) + internal AcsRouterWorkerOfferIssuedEventData() { - WorkerLabels = workerLabels; - WorkerTags = workerTags; - JobLabels = jobLabels; - JobTags = jobTags; + WorkerLabels = new ChangeTrackingDictionary(); + WorkerTags = new ChangeTrackingDictionary(); + JobLabels = new ChangeTrackingDictionary(); + JobTags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -41,7 +37,7 @@ internal AcsRouterWorkerOfferIssuedEventData(IDictionary workerL /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. - internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId, int? jobPriority, IDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IDictionary workerTags, IDictionary jobLabels, IDictionary jobTags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) + internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary additionalBinaryDataProperties, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, additionalBinaryDataProperties, workerId) { QueueId = queueId; OfferId = offerId; @@ -64,7 +60,7 @@ internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReferen public int? JobPriority { get; } /// Router Worker Offer Issued Worker Labels. - public IDictionary WorkerLabels { get; } + public IReadOnlyDictionary WorkerLabels { get; } /// Router Worker Offer Issued Time in UTC. public DateTimeOffset? OfferedOn { get; } @@ -73,12 +69,12 @@ internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReferen public DateTimeOffset? ExpiresOn { get; } /// Router Worker Offer Issued Worker Tags. - public IDictionary WorkerTags { get; } + public IReadOnlyDictionary WorkerTags { get; } /// Router Worker Offer Issued Job Labels. - public IDictionary JobLabels { get; } + public IReadOnlyDictionary JobLabels { get; } /// Router Worker Offer Issued Job Tags. - public IDictionary JobTags { get; } + public IReadOnlyDictionary JobTags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs index 0b4469011e90..c3c04bdce78e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterWorkerRegisteredEventDataConverter))] public partial class AcsRouterWorkerRegisteredEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerRegisteredEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -70,32 +65,38 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("totalCapacity"u8); writer.WriteNumberValue(TotalCapacity.Value); } - writer.WritePropertyName("labels"u8); - writer.WriteStartObject(); - foreach (var item in Labels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("labels"u8); + writer.WriteStartObject(); + foreach (var item in Labels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _additionalBinaryDataProperties != null) { foreach (var item in _additionalBinaryDataProperties) @@ -142,8 +143,8 @@ internal static AcsRouterWorkerRegisteredEventData DeserializeAcsRouterWorkerReg IReadOnlyList queueAssignments = default; IReadOnlyList channelConfigurations = default; int? totalCapacity = default; - IDictionary labels = default; - IDictionary tags = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs index 5dd2f3f33280..a00fe5841ed5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerRegisteredEventData.cs @@ -17,14 +17,12 @@ public partial class AcsRouterWorkerRegisteredEventData private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// Router Worker Registered Labels. - /// Router Worker Registered Tags. - internal AcsRouterWorkerRegisteredEventData(IDictionary labels, IDictionary tags) + internal AcsRouterWorkerRegisteredEventData() { QueueAssignments = new ChangeTrackingList(); ChannelConfigurations = new ChangeTrackingList(); - Labels = labels; - Tags = tags; + Labels = new ChangeTrackingDictionary(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -35,7 +33,7 @@ internal AcsRouterWorkerRegisteredEventData(IDictionary labels, /// Router Worker Registered Labels. /// Router Worker Registered Tags. /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IDictionary labels, IDictionary tags, IDictionary additionalBinaryDataProperties) + internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IDictionary additionalBinaryDataProperties) { WorkerId = workerId; QueueAssignments = queueAssignments; @@ -59,9 +57,9 @@ internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList Router Worker Registered Labels. - public IDictionary Labels { get; } + public IReadOnlyDictionary Labels { get; } /// Router Worker Registered Tags. - public IDictionary Tags { get; } + public IReadOnlyDictionary Tags { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs index a9e3dd84dc00..5e4233984c05 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.Serialization.cs @@ -17,11 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents [JsonConverter(typeof(AcsRouterWorkerUpdatedEventDataConverter))] public partial class AcsRouterWorkerUpdatedEventData : IJsonModel { - /// Initializes a new instance of for deserialization. - internal AcsRouterWorkerUpdatedEventData() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -70,32 +65,38 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("totalCapacity"u8); writer.WriteNumberValue(TotalCapacity.Value); } - writer.WritePropertyName("labels"u8); - writer.WriteStartObject(); - foreach (var item in Labels) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("labels"u8); + writer.WriteStartObject(); + foreach (var item in Labels) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W") { writer.WritePropertyName("updatedWorkerProperties"u8); @@ -152,8 +153,8 @@ internal static AcsRouterWorkerUpdatedEventData DeserializeAcsRouterWorkerUpdate IReadOnlyList queueAssignments = default; IReadOnlyList channelConfigurations = default; int? totalCapacity = default; - IDictionary labels = default; - IDictionary tags = default; + IReadOnlyDictionary labels = default; + IReadOnlyDictionary tags = default; IReadOnlyList updatedWorkerProperties = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs index 5307b77a48b0..7fb5fe0b3d0d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerUpdatedEventData.cs @@ -17,14 +17,12 @@ public partial class AcsRouterWorkerUpdatedEventData private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// Router Worker Updated Labels. - /// Router Worker Updated Tags. - internal AcsRouterWorkerUpdatedEventData(IDictionary labels, IDictionary tags) + internal AcsRouterWorkerUpdatedEventData() { QueueAssignments = new ChangeTrackingList(); ChannelConfigurations = new ChangeTrackingList(); - Labels = labels; - Tags = tags; + Labels = new ChangeTrackingDictionary(); + Tags = new ChangeTrackingDictionary(); UpdatedWorkerProperties = new ChangeTrackingList(); } @@ -37,7 +35,7 @@ internal AcsRouterWorkerUpdatedEventData(IDictionary labels, IDi /// Router Worker Updated Tags. /// Router Worker Properties Updated. /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerUpdatedEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IDictionary labels, IDictionary tags, IReadOnlyList updatedWorkerProperties, IDictionary additionalBinaryDataProperties) + internal AcsRouterWorkerUpdatedEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IReadOnlyList updatedWorkerProperties, IDictionary additionalBinaryDataProperties) { WorkerId = workerId; QueueAssignments = queueAssignments; @@ -62,10 +60,10 @@ internal AcsRouterWorkerUpdatedEventData(string workerId, IReadOnlyList Router Worker Updated Labels. - public IDictionary Labels { get; } + public IReadOnlyDictionary Labels { get; } /// Router Worker Updated Tags. - public IDictionary Tags { get; } + public IReadOnlyDictionary Tags { get; } /// Router Worker Properties Updated. public IReadOnlyList UpdatedWorkerProperties { get; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs index 217531950bf6..cf90e477f1f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.Serialization.cs @@ -41,19 +41,22 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(AvsScriptExecutionFinishedEventData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("namedOutputs"u8); - writer.WriteStartObject(); - foreach (var item in NamedOutputs) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("namedOutputs"u8); + writer.WriteStartObject(); + foreach (var item in NamedOutputs) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); } /// The JSON reader. @@ -85,7 +88,7 @@ internal static AvsScriptExecutionFinishedEventData DeserializeAvsScriptExecutio string cmdletId = default; IReadOnlyList output = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); - IDictionary namedOutputs = default; + IReadOnlyDictionary namedOutputs = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("operationId"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs index ad5bf05aea48..70262d72ec5c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs @@ -16,10 +16,9 @@ public partial class AvsScriptExecutionFinishedEventData : AvsScriptExecutionEve /// Initializes a new instance of . /// Id of the operation that caused this event. /// Cmdlet referenced in the execution that caused this event. - /// Named outputs of completed execution, if any. - internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IDictionary namedOutputs) : base(operationId, cmdletId) + internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId) : base(operationId, cmdletId) { - NamedOutputs = namedOutputs; + NamedOutputs = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -28,12 +27,12 @@ internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId /// Stdout outputs from the execution, if any. /// Keeps track of any properties unknown to the library. /// Named outputs of completed execution, if any. - internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties, IDictionary namedOutputs) : base(operationId, cmdletId, output, additionalBinaryDataProperties) + internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary additionalBinaryDataProperties, IReadOnlyDictionary namedOutputs) : base(operationId, cmdletId, output, additionalBinaryDataProperties) { NamedOutputs = namedOutputs; } /// Named outputs of completed execution, if any. - public IDictionary NamedOutputs { get; } + public IReadOnlyDictionary NamedOutputs { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs index 5bb04b5c83a0..5ac57dd60f69 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.Serialization.cs @@ -40,32 +40,38 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("body"u8); writer.WriteObjectValue(Body, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + foreach (var item in Properties) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("systemProperties"u8); - writer.WriteStartObject(); - foreach (var item in SystemProperties) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("systemProperties"u8); + writer.WriteStartObject(); + foreach (var item in SystemProperties) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _additionalBinaryDataProperties != null) { foreach (var item in _additionalBinaryDataProperties) @@ -109,8 +115,8 @@ internal static DeviceTelemetryEventProperties DeserializeDeviceTelemetryEventPr return null; } object body = default; - IDictionary properties = default; - IDictionary systemProperties = default; + IReadOnlyDictionary properties = default; + IReadOnlyDictionary systemProperties = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs index 91d08bca56d0..698978d1f50f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTelemetryEventProperties.cs @@ -18,13 +18,11 @@ public partial class DeviceTelemetryEventProperties /// Initializes a new instance of . /// The content of the message from the device. - /// Application properties are user-defined strings that can be added to the message. These fields are optional. - /// System properties help identify contents and source of the messages. - internal DeviceTelemetryEventProperties(object body, IDictionary properties, IDictionary systemProperties) + internal DeviceTelemetryEventProperties(object body) { Body = body; - Properties = properties; - SystemProperties = systemProperties; + Properties = new ChangeTrackingDictionary(); + SystemProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -32,7 +30,7 @@ internal DeviceTelemetryEventProperties(object body, IDictionary /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. /// Keeps track of any properties unknown to the library. - internal DeviceTelemetryEventProperties(object body, IDictionary properties, IDictionary systemProperties, IDictionary additionalBinaryDataProperties) + internal DeviceTelemetryEventProperties(object body, IReadOnlyDictionary properties, IReadOnlyDictionary systemProperties, IDictionary additionalBinaryDataProperties) { Body = body; Properties = properties; @@ -41,9 +39,9 @@ internal DeviceTelemetryEventProperties(object body, IDictionary } /// Application properties are user-defined strings that can be added to the message. These fields are optional. - public IDictionary Properties { get; } + public IReadOnlyDictionary Properties { get; } /// System properties help identify contents and source of the messages. - public IDictionary SystemProperties { get; } + public IReadOnlyDictionary SystemProperties { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs index ad89ab996eba..8be15d97ad6c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs @@ -536,7 +536,7 @@ public static AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventD /// Stdout outputs from the execution, if any. /// Named outputs of completed execution, if any. /// A new instance for mocking. - public static AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = default, string cmdletId = default, IEnumerable output = default, IDictionary namedOutputs = default) + public static AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = default, string cmdletId = default, IEnumerable output = default, IReadOnlyDictionary namedOutputs = default) { output ??= new ChangeTrackingList(); namedOutputs ??= new ChangeTrackingDictionary(); @@ -652,7 +652,7 @@ public static AcsMicrosoftTeamsAppIdentifier AcsMicrosoftTeamsAppIdentifier(stri /// Sip Headers for incoming call. /// Voip Headers for incoming call. /// A new instance for mocking. - public static AcsIncomingCallCustomContext AcsIncomingCallCustomContext(IDictionary sipHeaders = default, IDictionary voipHeaders = default) + public static AcsIncomingCallCustomContext AcsIncomingCallCustomContext(IReadOnlyDictionary sipHeaders = default, IReadOnlyDictionary voipHeaders = default) { sipHeaders ??= new ChangeTrackingDictionary(); voipHeaders ??= new ChangeTrackingDictionary(); @@ -875,23 +875,23 @@ public static AcsCallParticipantRemovedEventData AcsCallParticipantRemovedEventD userAgent); } - /// Schema of common properties of all chat events. - /// The communication identifier of the target user. + /// Schema of common properties of all thread-level chat events. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// A new instance for mocking. - public static AcsChatEventBaseProperties AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default) + /// A new instance for mocking. + public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = default, string threadId = default) { - return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties: null); + return new AcsChatEventInThreadBaseProperties(transactionId, threadId, additionalBinaryDataProperties: null); } - /// Schema of common properties of all thread-level chat events. + /// Schema of common properties of all chat events. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - /// A new instance for mocking. - public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = default, string threadId = default) + /// A new instance for mocking. + public static AcsChatEventBaseProperties AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default) { - return new AcsChatEventInThreadBaseProperties(transactionId, threadId, additionalBinaryDataProperties: null); + return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, additionalBinaryDataProperties: null); } /// Schema of common properties of all chat message events. @@ -933,7 +933,7 @@ public static AcsChatMessageEventBaseProperties AcsChatMessageEventBasePropertie /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) + public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IReadOnlyDictionary metadata = default) { metadata ??= new ChangeTrackingDictionary(); @@ -988,7 +988,7 @@ public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThr /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatAzureBotCommandReceivedInThreadEventData AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) + public static AcsChatAzureBotCommandReceivedInThreadEventData AcsChatAzureBotCommandReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IReadOnlyDictionary metadata = default) { metadata ??= new ChangeTrackingDictionary(); @@ -1018,7 +1018,7 @@ public static AcsChatAzureBotCommandReceivedInThreadEventData AcsChatAzureBotCom /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatTypingIndicatorReceivedInThreadEventData AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) + public static AcsChatTypingIndicatorReceivedInThreadEventData AcsChatTypingIndicatorReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IReadOnlyDictionary metadata = default) { metadata ??= new ChangeTrackingDictionary(); @@ -1048,7 +1048,7 @@ public static AcsChatTypingIndicatorReceivedInThreadEventData AcsChatTypingIndic /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default) + public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IReadOnlyDictionary metadata = default) { metadata ??= new ChangeTrackingDictionary(); @@ -1080,7 +1080,7 @@ public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInTh /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default, DateTimeOffset? editTime = default) + public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IReadOnlyDictionary metadata = default, DateTimeOffset? editTime = default) { metadata ??= new ChangeTrackingDictionary(); @@ -1113,7 +1113,7 @@ public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Commun /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IDictionary metadata = default, DateTimeOffset? editTime = default) + public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = default, string threadId = default, string messageId = default, CommunicationIdentifierModel senderCommunicationIdentifier = default, string senderDisplayName = default, DateTimeOffset? composeTime = default, string @type = default, long? version = default, string messageBody = default, IReadOnlyDictionary metadata = default, DateTimeOffset? editTime = default) { metadata ??= new ChangeTrackingDictionary(); @@ -1186,6 +1186,18 @@ public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThre deleteTime); } + /// Schema of the chat thread participant. + /// The name of the user. + /// The communication identifier of the user. + /// The metadata of the user. + /// A new instance for mocking. + public static AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = default, CommunicationIdentifierModel participantCommunicationIdentifier = default, IReadOnlyDictionary metadata = default) + { + metadata ??= new ChangeTrackingDictionary(); + + return new AcsChatThreadParticipantProperties(displayName, participantCommunicationIdentifier, metadata, additionalBinaryDataProperties: null); + } + /// Schema of common properties of all chat thread events. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. @@ -1215,7 +1227,7 @@ public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties( /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel createdByCommunicationIdentifier = default, IReadOnlyDictionary properties = default, IDictionary metadata = default, IEnumerable participants = default) + public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel createdByCommunicationIdentifier = default, IReadOnlyDictionary properties = default, IReadOnlyDictionary metadata = default, IEnumerable participants = default) { properties ??= new ChangeTrackingDictionary(); metadata ??= new ChangeTrackingDictionary(); @@ -1234,18 +1246,6 @@ public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUser participants.ToList()); } - /// Schema of the chat thread participant. - /// The name of the user. - /// The communication identifier of the user. - /// The metadata of the user. - /// A new instance for mocking. - public static AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = default, CommunicationIdentifierModel participantCommunicationIdentifier = default, IDictionary metadata = default) - { - metadata ??= new ChangeTrackingDictionary(); - - return new AcsChatThreadParticipantProperties(displayName, participantCommunicationIdentifier, metadata, additionalBinaryDataProperties: null); - } - /// Schema of common properties of all chat thread events. /// The transaction id will be used as co-relation vector. /// The chat thread id. @@ -1267,7 +1267,7 @@ public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThrea /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel createdByCommunicationIdentifier = default, IReadOnlyDictionary properties = default, IDictionary metadata = default, IEnumerable participants = default) + public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel createdByCommunicationIdentifier = default, IReadOnlyDictionary properties = default, IReadOnlyDictionary metadata = default, IEnumerable participants = default) { properties ??= new ChangeTrackingDictionary(); metadata ??= new ChangeTrackingDictionary(); @@ -1338,7 +1338,7 @@ public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string /// The thread metadata. /// The properties of the chat thread that were updated for the user. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel editedByCommunicationIdentifier = default, DateTimeOffset? editTime = default, IDictionary metadata = default, IReadOnlyDictionary properties = default) + public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = default, string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel editedByCommunicationIdentifier = default, DateTimeOffset? editTime = default, IReadOnlyDictionary metadata = default, IReadOnlyDictionary properties = default) { metadata ??= new ChangeTrackingDictionary(); properties ??= new ChangeTrackingDictionary(); @@ -1366,7 +1366,7 @@ public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadProper /// Gets the properties of the chat thread updated event. /// The thread metadata. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel editedByCommunicationIdentifier = default, DateTimeOffset? editTime = default, IReadOnlyDictionary properties = default, IDictionary metadata = default) + public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = default, string threadId = default, DateTimeOffset? createTime = default, long? version = default, CommunicationIdentifierModel editedByCommunicationIdentifier = default, DateTimeOffset? editTime = default, IReadOnlyDictionary properties = default, IReadOnlyDictionary metadata = default) { properties ??= new ChangeTrackingDictionary(); metadata ??= new ChangeTrackingDictionary(); @@ -1739,7 +1739,7 @@ public static AcsRouterJobClassifiedEventData AcsRouterJobClassifiedEventData(st /// Router Queue Name. /// Router Queue Labels. /// A new instance for mocking. - public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = default, string name = default, IDictionary labels = default) + public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = default, string name = default, IReadOnlyDictionary labels = default) { labels ??= new ChangeTrackingDictionary(); @@ -2109,7 +2109,7 @@ public static AcsRouterWorkerDeregisteredEventData AcsRouterWorkerDeregisteredEv /// Router Worker Offer Accepted Job Labels. /// Router Worker Offer Accepted Job Tags. /// A new instance for mocking. - public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default, string assignmentId = default, int? jobPriority = default, IDictionary workerLabels = default, IDictionary workerTags = default, IDictionary jobLabels = default, IDictionary jobTags = default) + public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default, string assignmentId = default, int? jobPriority = default, IReadOnlyDictionary workerLabels = default, IReadOnlyDictionary workerTags = default, IReadOnlyDictionary jobLabels = default, IReadOnlyDictionary jobTags = default) { workerLabels ??= new ChangeTrackingDictionary(); workerTags ??= new ChangeTrackingDictionary(); @@ -2187,7 +2187,7 @@ public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEv /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. /// A new instance for mocking. - public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default, int? jobPriority = default, IDictionary workerLabels = default, DateTimeOffset? offeredOn = default, DateTimeOffset? expiresOn = default, IDictionary workerTags = default, IDictionary jobLabels = default, IDictionary jobTags = default) + public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = default, string channelReference = default, string channelId = default, string workerId = default, string queueId = default, string offerId = default, int? jobPriority = default, IReadOnlyDictionary workerLabels = default, DateTimeOffset? offeredOn = default, DateTimeOffset? expiresOn = default, IReadOnlyDictionary workerTags = default, IReadOnlyDictionary jobLabels = default, IReadOnlyDictionary jobTags = default) { workerLabels ??= new ChangeTrackingDictionary(); workerTags ??= new ChangeTrackingDictionary(); @@ -2239,7 +2239,7 @@ public static AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEv /// Router Worker Registered Labels. /// Router Worker Registered Tags. /// A new instance for mocking. - public static AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = default, IEnumerable queueAssignments = default, IEnumerable channelConfigurations = default, int? totalCapacity = default, IDictionary labels = default, IDictionary tags = default) + public static AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = default, IEnumerable queueAssignments = default, IEnumerable channelConfigurations = default, int? totalCapacity = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default) { queueAssignments ??= new ChangeTrackingList(); channelConfigurations ??= new ChangeTrackingList(); @@ -2275,7 +2275,7 @@ public static AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string /// Router Worker Updated Tags. /// Router Worker Properties Updated. /// A new instance for mocking. - public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = default, IEnumerable queueAssignments = default, IEnumerable channelConfigurations = default, int? totalCapacity = default, IDictionary labels = default, IDictionary tags = default, IEnumerable updatedWorkerProperties = default) + public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = default, IEnumerable queueAssignments = default, IEnumerable channelConfigurations = default, int? totalCapacity = default, IReadOnlyDictionary labels = default, IReadOnlyDictionary tags = default, IEnumerable updatedWorkerProperties = default) { queueAssignments ??= new ChangeTrackingList(); channelConfigurations ??= new ChangeTrackingList(); @@ -2917,7 +2917,7 @@ public static DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(stri /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. /// A new instance for mocking. - public static DeviceTelemetryEventProperties DeviceTelemetryEventProperties(object body = default, IDictionary properties = default, IDictionary systemProperties = default) + public static DeviceTelemetryEventProperties DeviceTelemetryEventProperties(object body = default, IReadOnlyDictionary properties = default, IReadOnlyDictionary systemProperties = default) { properties ??= new ChangeTrackingDictionary(); systemProperties ??= new ChangeTrackingDictionary(); @@ -2972,7 +2972,7 @@ public static IotHubDeviceDisconnectedEventData IotHubDeviceDisconnectedEventDat /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. /// A new instance for mocking. - public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(object body = default, IDictionary properties = default, IDictionary systemProperties = default) + public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(object body = default, IReadOnlyDictionary properties = default, IReadOnlyDictionary systemProperties = default) { properties ??= new ChangeTrackingDictionary(); systemProperties ??= new ChangeTrackingDictionary(); @@ -3499,7 +3499,7 @@ public static RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData( /// The action being requested. /// The evidence for the authorization. /// A new instance for mocking. - public static ResourceAuthorization ResourceAuthorization(string scope = default, string action = default, IDictionary evidence = default) + public static ResourceAuthorization ResourceAuthorization(string scope = default, string action = default, IReadOnlyDictionary evidence = default) { evidence ??= new ChangeTrackingDictionary(); @@ -4334,12 +4334,12 @@ public static EventGridMqttClientEventData EventGridMqttClientEventData(string c /// Time the client resource is created based on the provider's UTC time. /// /// Time the client resource is last updated based on the provider's UTC time. If - /// the client resource was never updated, this value is identical to the value of - /// the 'createdOn' property. + /// the client resource was never updated, this value is identical to the value of + /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. /// A new instance for mocking. - public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default, EventGridMqttClientState? state = default, DateTimeOffset? createdOn = default, DateTimeOffset? updatedOn = default, IDictionary attributes = default) + public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = default, string clientName = default, string namespaceName = default, EventGridMqttClientState? state = default, DateTimeOffset? createdOn = default, DateTimeOffset? updatedOn = default, IReadOnlyDictionary attributes = default) { attributes ??= new ChangeTrackingDictionary(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs index 2762addd18fa..081b07b8ee4b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs @@ -56,19 +56,22 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("updatedOn"u8); writer.WriteStringValue(UpdatedOn.Value, "O"); } - writer.WritePropertyName("attributes"u8); - writer.WriteStartObject(); - foreach (var item in Attributes) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("attributes"u8); + writer.WriteStartObject(); + foreach (var item in Attributes) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); } /// The JSON reader. @@ -103,7 +106,7 @@ internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGri EventGridMqttClientState? state = default; DateTimeOffset? createdOn = default; DateTimeOffset? updatedOn = default; - IDictionary attributes = default; + IReadOnlyDictionary attributes = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("clientAuthenticationName"u8)) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs index 5a67ae92f1e6..0627712ebe4d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs @@ -20,10 +20,9 @@ public partial class EventGridMqttClientCreatedOrUpdatedEventData : EventGridMqt /// long, and supports UTF-8 characters. /// /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// The key-value attributes that are assigned to the client resource. - internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string namespaceName, IDictionary attributes) : base(clientAuthenticationName, namespaceName) + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string namespaceName) : base(clientAuthenticationName, namespaceName) { - Attributes = attributes; + Attributes = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -39,11 +38,11 @@ internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticatio /// Time the client resource is created based on the provider's UTC time. /// /// Time the client resource is last updated based on the provider's UTC time. If - /// the client resource was never updated, this value is identical to the value of - /// the 'createdOn' property. + /// the client resource was never updated, this value is identical to the value of + /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. - internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties) + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary additionalBinaryDataProperties, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, additionalBinaryDataProperties) { State = state; CreatedOn = createdOn; @@ -59,12 +58,12 @@ internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticatio /// /// Time the client resource is last updated based on the provider's UTC time. If - /// the client resource was never updated, this value is identical to the value of - /// the 'createdOn' property. + /// the client resource was never updated, this value is identical to the value of + /// the 'createdOn' property. /// public DateTimeOffset? UpdatedOn { get; } /// The key-value attributes that are assigned to the client resource. - public IDictionary Attributes { get; } + public IReadOnlyDictionary Attributes { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs index 69840086bae0..4209ed8f5776 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.Serialization.cs @@ -69,8 +69,8 @@ internal static IotHubDeviceTelemetryEventData DeserializeIotHubDeviceTelemetryE return null; } object body = default; - IDictionary properties = default; - IDictionary systemProperties = default; + IReadOnlyDictionary properties = default; + IReadOnlyDictionary systemProperties = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs index 3d630cfaa9a0..979da8c53779 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceTelemetryEventData.cs @@ -15,9 +15,7 @@ public partial class IotHubDeviceTelemetryEventData : DeviceTelemetryEventProper { /// Initializes a new instance of . /// The content of the message from the device. - /// Application properties are user-defined strings that can be added to the message. These fields are optional. - /// System properties help identify contents and source of the messages. - internal IotHubDeviceTelemetryEventData(object body, IDictionary properties, IDictionary systemProperties) : base(body, properties, systemProperties) + internal IotHubDeviceTelemetryEventData(object body) : base(body) { } @@ -26,7 +24,7 @@ internal IotHubDeviceTelemetryEventData(object body, IDictionary /// Application properties are user-defined strings that can be added to the message. These fields are optional. /// System properties help identify contents and source of the messages. /// Keeps track of any properties unknown to the library. - internal IotHubDeviceTelemetryEventData(object body, IDictionary properties, IDictionary systemProperties, IDictionary additionalBinaryDataProperties) : base(body, properties, systemProperties, additionalBinaryDataProperties) + internal IotHubDeviceTelemetryEventData(object body, IReadOnlyDictionary properties, IReadOnlyDictionary systemProperties, IDictionary additionalBinaryDataProperties) : base(body, properties, systemProperties, additionalBinaryDataProperties) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs index f0b42ecedda0..013e6d866e5a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/Models/AzureMessagingEventGridSystemEventsContext.cs @@ -89,8 +89,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents [ModelReaderWriterBuildable(typeof(AcsCallParticipantEventData))] [ModelReaderWriterBuildable(typeof(AcsCallParticipantAddedEventData))] [ModelReaderWriterBuildable(typeof(AcsCallParticipantRemovedEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatEventBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatEventInThreadBaseProperties))] + [ModelReaderWriterBuildable(typeof(AcsChatEventBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatMessageEventBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatMessageReceivedEventData))] [ModelReaderWriterBuildable(typeof(AcsChatMessageEventInThreadBaseProperties))] @@ -101,9 +101,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents [ModelReaderWriterBuildable(typeof(AcsChatMessageEditedInThreadEventData))] [ModelReaderWriterBuildable(typeof(AcsChatMessageDeletedEventData))] [ModelReaderWriterBuildable(typeof(AcsChatMessageDeletedInThreadEventData))] + [ModelReaderWriterBuildable(typeof(AcsChatThreadParticipantProperties))] [ModelReaderWriterBuildable(typeof(AcsChatThreadEventBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatThreadCreatedWithUserEventData))] - [ModelReaderWriterBuildable(typeof(AcsChatThreadParticipantProperties))] [ModelReaderWriterBuildable(typeof(AcsChatThreadEventInThreadBaseProperties))] [ModelReaderWriterBuildable(typeof(AcsChatThreadCreatedEventData))] [ModelReaderWriterBuildable(typeof(AcsChatThreadWithUserDeletedEventData))] @@ -236,9 +236,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents [ModelReaderWriterBuildable(typeof(RedisScalingCompletedEventData))] [ModelReaderWriterBuildable(typeof(RedisExportRdbCompletedEventData))] [ModelReaderWriterBuildable(typeof(RedisImportRdbCompletedEventData))] - [ModelReaderWriterBuildable(typeof(ResourceWriteSuccessEventData))] [ModelReaderWriterBuildable(typeof(ResourceAuthorization))] [ModelReaderWriterBuildable(typeof(ResourceHttpRequest))] + [ModelReaderWriterBuildable(typeof(ResourceWriteSuccessEventData))] [ModelReaderWriterBuildable(typeof(ResourceWriteFailureEventData))] [ModelReaderWriterBuildable(typeof(ResourceWriteCancelEventData))] [ModelReaderWriterBuildable(typeof(ResourceDeleteSuccessEventData))] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs index b2cf7a1dc744..eaf2b196a84e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs index eb6e8a5418ae..c92252af4cfe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionCancelEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceActionCancelEventData /// Initializes a new instance of . /// - /// /// - internal ResourceActionCancelEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceActionCancelEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs index b9a64ea0df14..ef87ceb492a9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs index 13ddbd6752ea..1d93112d45fb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionFailureEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceActionFailureEventData /// Initializes a new instance of . /// - /// /// - internal ResourceActionFailureEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceActionFailureEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs index ee91556d95d2..39519f09dd1a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs index 449039214ff9..f0b1417d2e89 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceActionSuccessEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceActionSuccessEventData /// Initializes a new instance of . /// - /// /// - internal ResourceActionSuccessEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceActionSuccessEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs index 242da330482a..16787e70cac2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.Serialization.cs @@ -15,11 +15,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// The details of the authorization for the resource. public partial class ResourceAuthorization : IJsonModel { - /// Initializes a new instance of for deserialization. - internal ResourceAuthorization() - { - } - /// The JSON writer. /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -48,19 +43,22 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("action"u8); writer.WriteStringValue(Action); } - writer.WritePropertyName("evidence"u8); - writer.WriteStartObject(); - foreach (var item in Evidence) + if (options.Format != "W") { - writer.WritePropertyName(item.Key); - if (item.Value == null) + writer.WritePropertyName("evidence"u8); + writer.WriteStartObject(); + foreach (var item in Evidence) { - writer.WriteNullValue(); - continue; + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item.Value); } - writer.WriteStringValue(item.Value); + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _additionalBinaryDataProperties != null) { foreach (var item in _additionalBinaryDataProperties) @@ -105,7 +103,7 @@ internal static ResourceAuthorization DeserializeResourceAuthorization(JsonEleme } string scope = default; string action = default; - IDictionary evidence = default; + IReadOnlyDictionary evidence = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs index b19d1f8c8707..d6a258c76957 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceAuthorization.cs @@ -17,10 +17,9 @@ public partial class ResourceAuthorization private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The evidence for the authorization. - internal ResourceAuthorization(IDictionary evidence) + internal ResourceAuthorization() { - Evidence = evidence; + Evidence = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -28,7 +27,7 @@ internal ResourceAuthorization(IDictionary evidence) /// The action being requested. /// The evidence for the authorization. /// Keeps track of any properties unknown to the library. - internal ResourceAuthorization(string scope, string action, IDictionary evidence, IDictionary additionalBinaryDataProperties) + internal ResourceAuthorization(string scope, string action, IReadOnlyDictionary evidence, IDictionary additionalBinaryDataProperties) { Scope = scope; Action = action; @@ -43,6 +42,6 @@ internal ResourceAuthorization(string scope, string action, IDictionary The evidence for the authorization. - public IDictionary Evidence { get; } + public IReadOnlyDictionary Evidence { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs index b64fbc34e02b..5a29a43add80 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs index f0316970bb5f..43c21c88874f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteCancelEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceDeleteCancelEventData /// Initializes a new instance of . /// - /// /// - internal ResourceDeleteCancelEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceDeleteCancelEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs index a3bafbacadab..32f4f29a707b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs index 6ef44cbc345a..bf0cdacfcc8d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteFailureEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceDeleteFailureEventData /// Initializes a new instance of . /// - /// /// - internal ResourceDeleteFailureEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceDeleteFailureEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs index 2cf27acbca19..167eaa825742 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs index 85fd76b73a4b..f1d3785cfd97 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceDeleteSuccessEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceDeleteSuccessEventData /// Initializes a new instance of . /// - /// /// - internal ResourceDeleteSuccessEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceDeleteSuccessEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs index 0cd4e354de96..2fc7ab3a5def 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.Serialization.cs @@ -52,7 +52,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("location"u8); writer.WriteStringValue(Location); } - if (Optional.IsCollectionDefined(ResourceTags)) + if (options.Format != "W" && Optional.IsCollectionDefined(ResourceTags)) { writer.WritePropertyName("tags"u8); writer.WriteStartObject(); @@ -68,7 +68,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } - if (Optional.IsCollectionDefined(Properties)) + if (options.Format != "W" && Optional.IsCollectionDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteStartObject(); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs index 13a847fce681..02b037903436 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs index 33134f30847e..c1938eec9f82 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteCancelEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceWriteCancelEventData /// Initializes a new instance of . /// - /// /// - internal ResourceWriteCancelEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceWriteCancelEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs index 8b910f7dbd4d..782b3612b929 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs index a22d97cd1209..b7efa49f080c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteFailureEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceWriteFailureEventData /// Initializes a new instance of . /// - /// /// - internal ResourceWriteFailureEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceWriteFailureEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs index 361a3039b806..702cf6b8cb1b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.Serialization.cs @@ -77,8 +77,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("authorization"u8); AuthorizationJson.WriteTo(writer); - writer.WritePropertyName("claims"u8); - ClaimsJson.WriteTo(writer); + if (options.Format != "W") + { + writer.WritePropertyName("claims"u8); + ClaimsJson.WriteTo(writer); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs index 066ec9650d2b..f85f340ba08c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceWriteSuccessEventData.cs @@ -19,12 +19,10 @@ public partial class ResourceWriteSuccessEventData /// Initializes a new instance of . /// - /// /// - internal ResourceWriteSuccessEventData(JsonElement authorizationJson, JsonElement claimsJson, JsonElement httpRequestJson) + internal ResourceWriteSuccessEventData(JsonElement authorizationJson, JsonElement httpRequestJson) { AuthorizationJson = authorizationJson; - ClaimsJson = claimsJson; HttpRequestJson = httpRequestJson; } From b5cdd86301c417a16f2921a34a7f1bba4c3d508e Mon Sep 17 00:00:00 2001 From: jolov Date: Tue, 12 Aug 2025 10:08:05 -0700 Subject: [PATCH 4/7] Migrate to new generator --- ...sourceNotificationsResourceDeletedDetails.Serialization.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs index 7150f944a12b..12d7f341dc53 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.Serialization.cs @@ -43,7 +43,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceNotificationsResourceDeletedDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("id"u8); - writer.WriteObjectValue(Resource, options); + writer.WriteStringValue(Resource); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); @@ -98,7 +98,7 @@ internal static ResourceNotificationsResourceDeletedDetails DeserializeResourceN { if (prop.NameEquals("id"u8)) { - resource = ResourceIdentifier.DeserializeResourceIdentifier(prop.Value, options); + resource = new ResourceIdentifier(prop.Value.GetString()); continue; } if (prop.NameEquals("name"u8)) From 1ee8178028c8fcb6b7054351cd7f5380f07d5a0a Mon Sep 17 00:00:00 2001 From: jolov Date: Tue, 12 Aug 2025 10:09:11 -0700 Subject: [PATCH 5/7] run migration script --- doc/GeneratorMigration/Library_Inventory.md | 31 +++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/doc/GeneratorMigration/Library_Inventory.md b/doc/GeneratorMigration/Library_Inventory.md index 0d82fbb54878..33d64c77a64c 100644 --- a/doc/GeneratorMigration/Library_Inventory.md +++ b/doc/GeneratorMigration/Library_Inventory.md @@ -2,24 +2,25 @@ ## Summary -- Total libraries: 404 +- Total libraries: 407 - Management Plane (Swagger): 170 -- Management Plane (TSP-Old): 45 +- Management Plane (TSP-Old): 48 - Management Plane (TypeSpec - @azure-typespec/http-client-csharp): 0 -- Data Plane (Swagger): 114 -- Data Plane (TSP-Old): 29 -- Data Plane (TypeSpec - @azure-typespec/http-client-csharp): 6 -- No generator: 40 +- Data Plane (Swagger): 115 +- Data Plane (TSP-Old): 28 +- Data Plane (TypeSpec - @azure-typespec/http-client-csharp): 7 +- No generator: 39 ## Data Plane Libraries using TypeSpec (@azure-typespec/http-client-csharp) -TypeSpec with @azure-typespec/http-client-csharp generator is detected by the presence of a tsp-location.yaml file with an emitterPackageJsonPath value referencing @azure-typespec/http-client-csharp, or through special handling for specific libraries. Total: 6 +TypeSpec with @azure-typespec/http-client-csharp generator is detected by the presence of a tsp-location.yaml file with an emitterPackageJsonPath value referencing @azure-typespec/http-client-csharp, or through special handling for specific libraries. Total: 7 | Service | Library | Path | | ------- | ------- | ---- | | appconfiguration | Azure.Data.AppConfiguration | sdk/appconfiguration/Azure.Data.AppConfiguration | | eventgrid | Azure.Messaging.EventGrid.Namespaces | sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces | +| eventgrid | Azure.Messaging.EventGrid.SystemEvents | sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents | | healthdataaiservices | Azure.Health.Deidentification | sdk/healthdataaiservices/Azure.Health.Deidentification | | keyvault | Azure.Security.KeyVault.Administration | sdk/keyvault/Azure.Security.KeyVault.Administration | | openai | Azure.AI.OpenAI | sdk/openai/Azure.AI.OpenAI | @@ -28,7 +29,7 @@ TypeSpec with @azure-typespec/http-client-csharp generator is detected by the pr ## Data Plane Libraries using TypeSpec (Old Generator) -TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 29 +TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 28 | Service | Library | Path | | ------- | ------- | ---- | @@ -49,7 +50,6 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f | devcenter | Azure.Developer.DevCenter | sdk/devcenter/Azure.Developer.DevCenter | | documentintelligence | Azure.AI.DocumentIntelligence | sdk/documentintelligence/Azure.AI.DocumentIntelligence | | easm | Azure.Analytics.Defender.Easm | sdk/easm/Azure.Analytics.Defender.Easm | -| eventgrid | Azure.Messaging.EventGrid.SystemEvents | sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents | | face | Azure.AI.Vision.Face | sdk/face/Azure.AI.Vision.Face | | healthinsights | Azure.Health.Insights.CancerProfiling | sdk/healthinsights/Azure.Health.Insights.CancerProfiling | | healthinsights | Azure.Health.Insights.ClinicalMatching | sdk/healthinsights/Azure.Health.Insights.ClinicalMatching | @@ -65,7 +65,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f ## Data Plane Libraries using Swagger -Total: 114 +Total: 115 | Service | Library | Path | | ------- | ------- | ---- | @@ -114,6 +114,7 @@ Total: 114 | eventgrid | Azure.Messaging.EventGrid | sdk/eventgrid/Azure.Messaging.EventGrid | | formrecognizer | Azure.AI.FormRecognizer | sdk/formrecognizer/Azure.AI.FormRecognizer | | iot | Azure.IoT.Hub.Service | sdk/iot/Azure.IoT.Hub.Service | +| loadtestservice | Azure.Developer.Playwright | sdk/loadtestservice/Azure.Developer.Playwright | | maps | Azure.Maps.Common | sdk/maps/Azure.Maps.Common | | maps | Azure.Maps.Geolocation | sdk/maps/Azure.Maps.Geolocation | | maps | Azure.Maps.Rendering | sdk/maps/Azure.Maps.Rendering | @@ -187,7 +188,7 @@ Total: 114 ## Management Plane Libraries using TypeSpec (Old Generator) -TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 45 +TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 48 | Service | Library | Path | | ------- | ------- | ---- | @@ -208,6 +209,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f | deviceregistry | Azure.ResourceManager.DeviceRegistry | sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry | | devopsinfrastructure | Azure.ResourceManager.DevOpsInfrastructure | sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure | | durabletask | Azure.ResourceManager.DurableTask | sdk/durabletask/Azure.ResourceManager.DurableTask | +| elasticsan | Azure.ResourceManager.ElasticSan | sdk/elasticsan/Azure.ResourceManager.ElasticSan | | fabric | Azure.ResourceManager.Fabric | sdk/fabric/Azure.ResourceManager.Fabric | | grafana | Azure.ResourceManager.Grafana | sdk/grafana/Azure.ResourceManager.Grafana | | hardwaresecuritymodules | Azure.ResourceManager.HardwareSecurityModules | sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules | @@ -223,6 +225,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f | oracle | Azure.ResourceManager.OracleDatabase | sdk/oracle/Azure.ResourceManager.OracleDatabase | | pineconevectordb | Azure.ResourceManager.PineconeVectorDB | sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDB | | planetarycomputer | Azure.ResourceManager.PlanetaryComputer | sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer | +| playwright | Azure.ResourceManager.Playwright | sdk/playwright/Azure.ResourceManager.Playwright | | playwrighttesting | Azure.ResourceManager.PlaywrightTesting | sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting | | portalservices | Azure.ResourceManager.PortalServicesCopilot | sdk/portalservices/Azure.ResourceManager.PortalServicesCopilot | | purestorageblock | Azure.ResourceManager.PureStorageBlock | sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock | @@ -233,6 +236,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f | sitemanager | Azure.ResourceManager.SiteManager | sdk/sitemanager/Azure.ResourceManager.SiteManager | | standbypool | Azure.ResourceManager.StandbyPool | sdk/standbypool/Azure.ResourceManager.StandbyPool | | storageactions | Azure.ResourceManager.StorageActions | sdk/storageactions/Azure.ResourceManager.StorageActions | +| storagediscovery | Azure.ResourceManager.StorageDiscovery | sdk/storagediscovery/Azure.ResourceManager.StorageDiscovery | | terraform | Azure.ResourceManager.Terraform | sdk/terraform/Azure.ResourceManager.Terraform | | weightsandbiases | Azure.ResourceManager.WeightsAndBiases | sdk/weightsandbiases/Azure.ResourceManager.WeightsAndBiases | | workloadssapvirtualinstance | Azure.ResourceManager.WorkloadsSapVirtualInstance | sdk/workloadssapvirtualinstance/Azure.ResourceManager.WorkloadsSapVirtualInstance | @@ -306,7 +310,6 @@ Total: 170 | edgeorder | Azure.ResourceManager.EdgeOrder | sdk/edgeorder/Azure.ResourceManager.EdgeOrder | | edgezones | Azure.ResourceManager.EdgeZones | sdk/edgezones/Azure.ResourceManager.EdgeZones | | elastic | Azure.ResourceManager.Elastic | sdk/elastic/Azure.ResourceManager.Elastic | -| elasticsan | Azure.ResourceManager.ElasticSan | sdk/elasticsan/Azure.ResourceManager.ElasticSan | | eventgrid | Azure.ResourceManager.EventGrid | sdk/eventgrid/Azure.ResourceManager.EventGrid | | eventhub | Azure.ResourceManager.EventHubs | sdk/eventhub/Azure.ResourceManager.EventHubs | | extendedlocation | Azure.ResourceManager.ExtendedLocations | sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations | @@ -385,6 +388,7 @@ Total: 170 | resourcemanager | Azure.ResourceManager | sdk/resourcemanager/Azure.ResourceManager | | resourcemover | Azure.ResourceManager.ResourceMover | sdk/resourcemover/Azure.ResourceManager.ResourceMover | | resources | Azure.ResourceManager.Resources | sdk/resources/Azure.ResourceManager.Resources | +| resources | Azure.ResourceManager.Resources.DeploymentStacks | sdk/resources/Azure.ResourceManager.Resources.DeploymentStacks | | search | Azure.ResourceManager.Search | sdk/search/Azure.ResourceManager.Search | | securitycenter | Azure.ResourceManager.SecurityCenter | sdk/securitycenter/Azure.ResourceManager.SecurityCenter | | securitydevops | Azure.ResourceManager.SecurityDevOps | sdk/securitydevops/Azure.ResourceManager.SecurityDevOps | @@ -418,7 +422,7 @@ Total: 170 ## Libraries with No Generator -Libraries with no generator have neither autorest.md nor tsp-location.yaml files. Total: 40 +Libraries with no generator have neither autorest.md nor tsp-location.yaml files. Total: 39 | Service | Library | Path | | ------- | ------- | ---- | @@ -446,7 +450,6 @@ Libraries with no generator have neither autorest.md nor tsp-location.yaml files | keyvault | Azure.Security.KeyVault.Keys | sdk/keyvault/Azure.Security.KeyVault.Keys | | keyvault | Azure.Security.KeyVault.Secrets | sdk/keyvault/Azure.Security.KeyVault.Secrets | | keyvault | Azure.Security.KeyVault.Shared | sdk/keyvault/Azure.Security.KeyVault.Shared | -| loadtestservice | Azure.Developer.Playwright | sdk/loadtestservice/Azure.Developer.Playwright | | loadtestservice | Azure.Developer.Playwright.MSTest | sdk/loadtestservice/Azure.Developer.Playwright.MSTest | | loadtestservice | Azure.Developer.Playwright.NUnit | sdk/loadtestservice/Azure.Developer.Playwright.NUnit | | modelsrepository | Azure.IoT.ModelsRepository | sdk/modelsrepository/Azure.IoT.ModelsRepository | From 3afa889be311cb510e05bbc0cb562d30206280b7 Mon Sep 17 00:00:00 2001 From: jolov Date: Tue, 12 Aug 2025 12:13:15 -0700 Subject: [PATCH 6/7] api --- .../CHANGELOG.md | 2 + ...Messaging.EventGrid.SystemEvents.net8.0.cs | 896 ++++++++++++++++++ ...g.EventGrid.SystemEvents.netstandard2.0.cs | 896 ++++++++++++++++++ 3 files changed, 1794 insertions(+) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md index 668b8755245b..d7a312415c18 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Implemented `IJsonModel` and `IPersistableModel` deserialization methods for events. + ### Bug Fixes ### Other Changes diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs index 8fba53de397d..bc122a85489d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs @@ -129,6 +129,7 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset? offeredOn = default(System.DateTimeOffset?), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? @operator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator?), object labelValue = null, double? ttlSeconds = default(double?), Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? selectorState = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState?), System.DateTimeOffset? expirationTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable updatedWorkerProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), string tag = null) { throw null; } @@ -365,10 +366,12 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData ResourceDeleteFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData ResourceDeleteSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, Azure.Core.RequestMethod? method = default(Azure.Core.RequestMethod?), string url = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string methodString = null, string url = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(Azure.Core.ResourceIdentifier resource = null, string name = null, string type = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData ResourceNotificationsResourceManagementDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; } @@ -398,6 +401,7 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, bool? recursive = default(bool?), string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, string recursiveString = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -812,6 +816,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind right) { throw null; } public override string ToString() { throw null; } } @@ -821,7 +826,10 @@ internal AcsCallEndedByProperties() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind? Kind { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -834,7 +842,10 @@ internal AcsCallEndedEventData() { } public System.TimeSpan? CallDuration { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties EndedBy { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties Reason { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -847,7 +858,10 @@ internal AcsCallEndReasonProperties() { } public int? Code { get { throw null; } } public string Phrase { get { throw null; } } public int? SubCode { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -858,7 +872,10 @@ public partial class AcsCallGroupProperties : System.ClientModel.Primitives.IJso { internal AcsCallGroupProperties() { } public string Id { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -875,7 +892,10 @@ internal AcsCallingEventProperties() { } public Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties Room { get { throw null; } } public string ServerCallId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties StartedBy { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -885,7 +905,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsCallParticipantAddedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsCallParticipantAddedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantAddedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantAddedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -899,7 +922,10 @@ internal AcsCallParticipantEventData() { } public string ParticipantId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties User { get { throw null; } } public string UserAgent { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -924,6 +950,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind right) { throw null; } public override string ToString() { throw null; } } @@ -932,7 +959,10 @@ public partial class AcsCallParticipantProperties : System.ClientModel.Primitive internal AcsCallParticipantProperties() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind? Role { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -942,7 +972,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsCallParticipantRemovedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsCallParticipantRemovedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantRemovedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantRemovedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -953,7 +986,10 @@ public partial class AcsCallRoomProperties : System.ClientModel.Primitives.IJson { internal AcsCallRoomProperties() { } public string Id { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -963,7 +999,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsCallStartedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsCallStartedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -975,7 +1014,10 @@ public partial class AcsChatAzureBotCommandReceivedInThreadEventData : Azure.Mes internal AcsChatAzureBotCommandReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatAzureBotCommandReceivedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatAzureBotCommandReceivedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -988,7 +1030,10 @@ internal AcsChatEventBaseProperties() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RecipientCommunicationIdentifier { get { throw null; } } public string ThreadId { get { throw null; } } public string TransactionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1000,7 +1045,10 @@ public partial class AcsChatEventInThreadBaseProperties : System.ClientModel.Pri internal AcsChatEventInThreadBaseProperties() { } public string ThreadId { get { throw null; } } public string TransactionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1011,7 +1059,10 @@ public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid. { internal AcsChatMessageDeletedEventData() { } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1022,7 +1073,10 @@ public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.Ev { internal AcsChatMessageDeletedInThreadEventData() { } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1035,7 +1089,10 @@ internal AcsChatMessageEditedEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1048,7 +1105,10 @@ internal AcsChatMessageEditedInThreadEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1064,7 +1124,10 @@ internal AcsChatMessageEventBaseProperties() { } public string SenderDisplayName { get { throw null; } } public string Type { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1080,7 +1143,10 @@ internal AcsChatMessageEventInThreadBaseProperties() { } public string SenderDisplayName { get { throw null; } } public string Type { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1092,7 +1158,10 @@ public partial class AcsChatMessageReceivedEventData : Azure.Messaging.EventGrid internal AcsChatMessageReceivedEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1104,7 +1173,10 @@ public partial class AcsChatMessageReceivedInThreadEventData : Azure.Messaging.E internal AcsChatMessageReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1118,7 +1190,10 @@ internal AcsChatParticipantAddedToThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1131,7 +1206,10 @@ internal AcsChatParticipantAddedToThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1145,7 +1223,10 @@ internal AcsChatParticipantRemovedFromThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1158,7 +1239,10 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1172,7 +1256,10 @@ internal AcsChatThreadCreatedEventData() { } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyList Participants { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1186,7 +1273,10 @@ internal AcsChatThreadCreatedWithUserEventData() { } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyList Participants { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1198,7 +1288,10 @@ public partial class AcsChatThreadDeletedEventData : Azure.Messaging.EventGrid.S internal AcsChatThreadDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1210,7 +1303,10 @@ public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGri internal AcsChatThreadEventBaseProperties() { } public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1222,7 +1318,10 @@ public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging. internal AcsChatThreadEventInThreadBaseProperties() { } public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1235,7 +1334,10 @@ internal AcsChatThreadParticipantProperties() { } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel ParticipantCommunicationIdentifier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1249,7 +1351,10 @@ internal AcsChatThreadPropertiesUpdatedEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1263,7 +1368,10 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1275,7 +1383,10 @@ public partial class AcsChatThreadWithUserDeletedEventData : Azure.Messaging.Eve internal AcsChatThreadWithUserDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1287,7 +1398,10 @@ public partial class AcsChatTypingIndicatorReceivedInThreadEventData : Azure.Mes internal AcsChatTypingIndicatorReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatTypingIndicatorReceivedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatTypingIndicatorReceivedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1312,6 +1426,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind right) { throw null; } public override string ToString() { throw null; } } @@ -1325,7 +1440,10 @@ internal AcsEmailDeliveryReportReceivedEventData() { } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? Status { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1351,6 +1469,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1359,7 +1478,10 @@ public partial class AcsEmailDeliveryReportStatusDetails : System.ClientModel.Pr internal AcsEmailDeliveryReportStatusDetails() { } public string RecipientMailServerHostName { get { throw null; } } public string StatusMessage { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1376,7 +1498,10 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() { } public string Sender { get { throw null; } } public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1388,7 +1513,10 @@ public partial class AcsIncomingCallCustomContext : System.ClientModel.Primitive internal AcsIncomingCallCustomContext() { } public System.Collections.Generic.IReadOnlyDictionary SipHeaders { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary VoipHeaders { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1406,7 +1534,10 @@ internal AcsIncomingCallEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel OnBehalfOfCallee { get { throw null; } } public string ServerCallId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel ToCommunicationIdentifier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1429,6 +1560,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind left, Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind left, Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind right) { throw null; } public override string ToString() { throw null; } } @@ -1437,7 +1569,10 @@ public partial class AcsMessageButtonContent : System.ClientModel.Primitives.IJs internal AcsMessageButtonContent() { } public string Payload { get { throw null; } } public string Text { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1458,6 +1593,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind right) { throw null; } public override string ToString() { throw null; } } @@ -1466,7 +1602,10 @@ public partial class AcsMessageContext : System.ClientModel.Primitives.IJsonMode internal AcsMessageContext() { } public string From { get { throw null; } } public string MessageId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1492,6 +1631,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1501,7 +1641,10 @@ internal AcsMessageDeliveryStatusUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? ChannelKind { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? Status { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1515,7 +1658,10 @@ internal AcsMessageEventData() { } public string From { get { throw null; } } public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string To { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1527,7 +1673,10 @@ public partial class AcsMessageInteractiveButtonReplyContent : System.ClientMode internal AcsMessageInteractiveButtonReplyContent() { } public string ButtonId { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1540,7 +1689,10 @@ internal AcsMessageInteractiveContent() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent ButtonReply { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent ListReply { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? ReplyKind { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1553,7 +1705,10 @@ internal AcsMessageInteractiveListReplyContent() { } public string Description { get { throw null; } } public string ListItemId { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1568,7 +1723,10 @@ internal AcsMessageMediaContent() { } public string FileName { get { throw null; } } public string MediaId { get { throw null; } } public string MimeType { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1580,7 +1738,10 @@ public partial class AcsMessageReactionContent : System.ClientModel.Primitives.I internal AcsMessageReactionContent() { } public string Emoji { get { throw null; } } public string MessageId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1599,7 +1760,10 @@ internal AcsMessageReceivedEventData() { } public string MessageId { get { throw null; } } public string MessageType { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent Reaction { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1611,7 +1775,10 @@ public partial class AcsMicrosoftTeamsAppIdentifier : System.ClientModel.Primiti internal AcsMicrosoftTeamsAppIdentifier() { } public string AppId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1633,6 +1800,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType right) { throw null; } public override string ToString() { throw null; } } @@ -1645,7 +1813,10 @@ internal AcsRecordingChunkInfoProperties() { } public string EndReason { get { throw null; } } public long? Index { get { throw null; } } public string MetadataLocation { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1667,6 +1838,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType right) { throw null; } public override string ToString() { throw null; } } @@ -1686,7 +1858,10 @@ internal AcsRecordingFileStatusUpdatedEventData() { } public System.DateTimeOffset? RecordingStartTime { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties RecordingStorageInfo { get { throw null; } } public string SessionEndReason { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1709,6 +1884,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType right) { throw null; } public override string ToString() { throw null; } } @@ -1716,7 +1892,10 @@ public partial class AcsRecordingStorageInfoProperties : System.ClientModel.Prim { internal AcsRecordingStorageInfoProperties() { } public System.Collections.Generic.IReadOnlyList RecordingChunks { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1729,7 +1908,10 @@ internal AcsRouterChannelConfiguration() { } public int? CapacityCostPerJob { get { throw null; } } public string ChannelId { get { throw null; } } public int? MaxNumberOfJobs { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1742,7 +1924,10 @@ internal AcsRouterEventData() { } public string ChannelId { get { throw null; } } public string ChannelReference { get { throw null; } } public string JobId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1754,7 +1939,10 @@ public partial class AcsRouterJobCancelledEventData : Azure.Messaging.EventGrid. internal AcsRouterJobCancelledEventData() { } public string DispositionCode { get { throw null; } } public string Note { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCancelledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCancelledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1766,7 +1954,10 @@ public partial class AcsRouterJobClassificationFailedEventData : Azure.Messaging internal AcsRouterJobClassificationFailedEventData() { } public string ClassificationPolicyId { get { throw null; } } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassificationFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassificationFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1780,7 +1971,10 @@ internal AcsRouterJobClassifiedEventData() { } public string ClassificationPolicyId { get { throw null; } } public int? Priority { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails QueueDetails { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassifiedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassifiedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1793,7 +1987,10 @@ internal AcsRouterJobClosedEventData() { } public string AssignmentId { get { throw null; } } public string DispositionCode { get { throw null; } } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClosedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClosedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1805,7 +2002,10 @@ public partial class AcsRouterJobCompletedEventData : Azure.Messaging.EventGrid. internal AcsRouterJobCompletedEventData() { } public string AssignmentId { get { throw null; } } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1815,7 +2015,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsRouterJobDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterJobDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1828,7 +2031,10 @@ internal AcsRouterJobEventData() { } public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1840,7 +2046,10 @@ public partial class AcsRouterJobExceptionTriggeredEventData : Azure.Messaging.E internal AcsRouterJobExceptionTriggeredEventData() { } public string ExceptionRuleId { get { throw null; } } public string RuleKey { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1853,7 +2062,10 @@ internal AcsRouterJobQueuedEventData() { } public System.Collections.Generic.IReadOnlyList AttachedWorkerSelectors { get { throw null; } } public int? Priority { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1871,7 +2083,10 @@ internal AcsRouterJobReceivedEventData() { } public System.DateTimeOffset? ScheduledOn { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? Status { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1886,7 +2101,10 @@ internal AcsRouterJobSchedulingFailedEventData() { } public string FailureReason { get { throw null; } } public int? Priority { get { throw null; } } public System.DateTimeOffset? ScheduledOn { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1918,6 +2136,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1926,7 +2145,10 @@ public partial class AcsRouterJobUnassignedEventData : Azure.Messaging.EventGrid internal AcsRouterJobUnassignedEventData() { } public string AssignmentId { get { throw null; } } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1941,7 +2163,10 @@ internal AcsRouterJobWaitingForActivationEventData() { } public int? Priority { get { throw null; } } public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1953,7 +2178,10 @@ public partial class AcsRouterJobWorkerSelectorsExpiredEventData : Azure.Messagi internal AcsRouterJobWorkerSelectorsExpiredEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1979,6 +2207,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator right) { throw null; } public override string ToString() { throw null; } } @@ -1988,7 +2217,10 @@ internal AcsRouterQueueDetails() { } public string Id { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2014,13 +2246,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty right) { throw null; } public override string ToString() { throw null; } } public partial class AcsRouterWorkerDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2031,7 +2267,10 @@ public partial class AcsRouterWorkerDeregisteredEventData : System.ClientModel.P { internal AcsRouterWorkerDeregisteredEventData() { } public string WorkerId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2042,7 +2281,10 @@ public partial class AcsRouterWorkerEventData : Azure.Messaging.EventGrid.System { internal AcsRouterWorkerEventData() { } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2060,7 +2302,10 @@ internal AcsRouterWorkerOfferAcceptedEventData() { } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerTags { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2072,7 +2317,10 @@ public partial class AcsRouterWorkerOfferDeclinedEventData : Azure.Messaging.Eve internal AcsRouterWorkerOfferDeclinedEventData() { } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2084,7 +2332,10 @@ public partial class AcsRouterWorkerOfferExpiredEventData : Azure.Messaging.Even internal AcsRouterWorkerOfferExpiredEventData() { } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2103,7 +2354,10 @@ internal AcsRouterWorkerOfferIssuedEventData() { } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerTags { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2115,7 +2369,10 @@ public partial class AcsRouterWorkerOfferRevokedEventData : Azure.Messaging.Even internal AcsRouterWorkerOfferRevokedEventData() { } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2131,7 +2388,10 @@ internal AcsRouterWorkerRegisteredEventData() { } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } public int? TotalCapacity { get { throw null; } } public string WorkerId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2151,7 +2411,10 @@ internal AcsRouterWorkerSelector() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState? State { get { throw null; } } public System.TimeSpan? TimeToLive { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2173,6 +2436,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState right) { throw null; } public override string ToString() { throw null; } } @@ -2186,7 +2450,10 @@ internal AcsRouterWorkerUpdatedEventData() { } public int? TotalCapacity { get { throw null; } } public System.Collections.Generic.IReadOnlyList UpdatedWorkerProperties { get { throw null; } } public string WorkerId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2199,7 +2466,10 @@ internal AcsSmsDeliveryAttemptProperties() { } public int? SegmentsFailed { get { throw null; } } public int? SegmentsSucceeded { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2214,7 +2484,10 @@ internal AcsSmsDeliveryReportReceivedEventData() { } public string DeliveryStatusDetails { get { throw null; } } public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string Tag { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2227,7 +2500,10 @@ internal AcsSmsEventBaseProperties() { } public string From { get { throw null; } } public string MessageId { get { throw null; } } public string To { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2240,7 +2516,10 @@ internal AcsSmsReceivedEventData() { } public string Message { get { throw null; } } public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public int SegmentCount { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2251,7 +2530,10 @@ public partial class AcsUserDisconnectedEventData : System.ClientModel.Primitive { internal AcsUserDisconnectedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel UserCommunicationIdentifier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2273,6 +2555,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement left, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement left, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement right) { throw null; } public override string ToString() { throw null; } } @@ -2282,7 +2565,10 @@ internal ApiCenterApiDefinitionAddedEventData() { } public string Description { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification Specification { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2295,7 +2581,10 @@ internal ApiCenterApiDefinitionUpdatedEventData() { } public string Description { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification Specification { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2307,7 +2596,10 @@ public partial class ApiCenterApiSpecification : System.ClientModel.Primitives.I internal ApiCenterApiSpecification() { } public string Name { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2318,7 +2610,10 @@ public partial class ApiManagementApiCreatedEventData : System.ClientModel.Primi { internal ApiManagementApiCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2329,7 +2624,10 @@ public partial class ApiManagementApiDeletedEventData : System.ClientModel.Primi { internal ApiManagementApiDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2340,7 +2638,10 @@ public partial class ApiManagementApiReleaseCreatedEventData : System.ClientMode { internal ApiManagementApiReleaseCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2351,7 +2652,10 @@ public partial class ApiManagementApiReleaseDeletedEventData : System.ClientMode { internal ApiManagementApiReleaseDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2362,7 +2666,10 @@ public partial class ApiManagementApiReleaseUpdatedEventData : System.ClientMode { internal ApiManagementApiReleaseUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2373,7 +2680,10 @@ public partial class ApiManagementApiUpdatedEventData : System.ClientModel.Primi { internal ApiManagementApiUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2385,7 +2695,10 @@ public partial class ApiManagementCircuitBreakerClosedEventData : System.ClientM internal ApiManagementCircuitBreakerClosedEventData() { } public string BackendName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties CircuitBreaker { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2397,7 +2710,10 @@ public partial class ApiManagementCircuitBreakerOpenedEventData : System.ClientM internal ApiManagementCircuitBreakerOpenedEventData() { } public string BackendName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties CircuitBreaker { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2408,7 +2724,10 @@ public partial class ApiManagementCircuitBreakerProperties : System.ClientModel. { internal ApiManagementCircuitBreakerProperties() { } public System.Collections.Generic.IReadOnlyDictionary Rules { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2419,7 +2738,10 @@ public partial class ApiManagementExpiredGatewayTokenProperties : System.ClientM { internal ApiManagementExpiredGatewayTokenProperties() { } public System.DateTimeOffset? ExpiresOn { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2430,7 +2752,10 @@ public partial class ApiManagementGatewayApiAddedEventData : System.ClientModel. { internal ApiManagementGatewayApiAddedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2441,7 +2766,10 @@ public partial class ApiManagementGatewayApiRemovedEventData : System.ClientMode { internal ApiManagementGatewayApiRemovedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2452,7 +2780,10 @@ public partial class ApiManagementGatewayCertificateAuthorityCreatedEventData : { internal ApiManagementGatewayCertificateAuthorityCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2463,7 +2794,10 @@ public partial class ApiManagementGatewayCertificateAuthorityDeletedEventData : { internal ApiManagementGatewayCertificateAuthorityDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2474,7 +2808,10 @@ public partial class ApiManagementGatewayCertificateAuthorityUpdatedEventData : { internal ApiManagementGatewayCertificateAuthorityUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2485,7 +2822,10 @@ public partial class ApiManagementGatewayCreatedEventData : System.ClientModel.P { internal ApiManagementGatewayCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2496,7 +2836,10 @@ public partial class ApiManagementGatewayDeletedEventData : System.ClientModel.P { internal ApiManagementGatewayDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2507,7 +2850,10 @@ public partial class ApiManagementGatewayHostnameConfigurationCreatedEventData : { internal ApiManagementGatewayHostnameConfigurationCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2518,7 +2864,10 @@ public partial class ApiManagementGatewayHostnameConfigurationDeletedEventData : { internal ApiManagementGatewayHostnameConfigurationDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2529,7 +2878,10 @@ public partial class ApiManagementGatewayHostnameConfigurationUpdatedEventData : { internal ApiManagementGatewayHostnameConfigurationUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2541,7 +2893,10 @@ public partial class ApiManagementGatewayProperties : System.ClientModel.Primiti internal ApiManagementGatewayProperties() { } public string GatewayId { get { throw null; } } public string InstanceId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2553,7 +2908,10 @@ public partial class ApiManagementGatewayTokenExpiredEventData : System.ClientMo internal ApiManagementGatewayTokenExpiredEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties Gateway { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties Token { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2565,7 +2923,10 @@ public partial class ApiManagementGatewayTokenNearExpiryEventData : System.Clien internal ApiManagementGatewayTokenNearExpiryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties Gateway { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties Token { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2576,7 +2937,10 @@ public partial class ApiManagementGatewayTokenNearExpiryProperties : System.Clie { internal ApiManagementGatewayTokenNearExpiryProperties() { } public System.DateTimeOffset? ExpiresOn { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2587,7 +2951,10 @@ public partial class ApiManagementGatewayUpdatedEventData : System.ClientModel.P { internal ApiManagementGatewayUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2598,7 +2965,10 @@ public partial class ApiManagementProductCreatedEventData : System.ClientModel.P { internal ApiManagementProductCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2609,7 +2979,10 @@ public partial class ApiManagementProductDeletedEventData : System.ClientModel.P { internal ApiManagementProductDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2620,7 +2993,10 @@ public partial class ApiManagementProductUpdatedEventData : System.ClientModel.P { internal ApiManagementProductUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2631,7 +3007,10 @@ public partial class ApiManagementSubscriptionCreatedEventData : System.ClientMo { internal ApiManagementSubscriptionCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2642,7 +3021,10 @@ public partial class ApiManagementSubscriptionDeletedEventData : System.ClientMo { internal ApiManagementSubscriptionDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2653,7 +3035,10 @@ public partial class ApiManagementSubscriptionUpdatedEventData : System.ClientMo { internal ApiManagementSubscriptionUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2664,7 +3049,10 @@ public partial class ApiManagementUserCreatedEventData : System.ClientModel.Prim { internal ApiManagementUserCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2675,7 +3063,10 @@ public partial class ApiManagementUserDeletedEventData : System.ClientModel.Prim { internal ApiManagementUserDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2686,7 +3077,10 @@ public partial class ApiManagementUserUpdatedEventData : System.ClientModel.Prim { internal ApiManagementUserUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2712,6 +3106,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AppAction left, Azure.Messaging.EventGrid.SystemEvents.AppAction right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppAction (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppAction? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AppAction left, Azure.Messaging.EventGrid.SystemEvents.AppAction right) { throw null; } public override string ToString() { throw null; } } @@ -2722,7 +3117,10 @@ internal AppConfigurationKeyValueDeletedEventData() { } public string Key { get { throw null; } } public string Label { get { throw null; } } public string SyncToken { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2736,7 +3134,10 @@ internal AppConfigurationKeyValueModifiedEventData() { } public string Key { get { throw null; } } public string Label { get { throw null; } } public string SyncToken { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2746,7 +3147,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppConfigurationSnapshotCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppConfigurationSnapshotCreatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2759,7 +3163,10 @@ internal AppConfigurationSnapshotEventData() { } public string ETag { get { throw null; } } public string Name { get { throw null; } } public string SyncToken { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2769,7 +3176,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppConfigurationSnapshotModifiedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppConfigurationSnapshotModifiedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2780,7 +3190,10 @@ public partial class AppEventTypeDetail : System.ClientModel.Primitives.IJsonMod { internal AppEventTypeDetail() { } public Azure.Messaging.EventGrid.SystemEvents.AppAction? Action { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2801,6 +3214,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction left, Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction left, Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction right) { throw null; } public override string ToString() { throw null; } } @@ -2810,7 +3224,10 @@ internal AppServicePlanEventTypeDetail() { } public Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? Action { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StampKind? StampKind { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? Status { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2833,13 +3250,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus left, Azure.Messaging.EventGrid.SystemEvents.AsyncStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AsyncStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus left, Azure.Messaging.EventGrid.SystemEvents.AsyncStatus right) { throw null; } public override string ToString() { throw null; } } public partial class AvsClusterCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterCreatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2849,7 +3270,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsClusterDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2863,7 +3287,10 @@ internal AvsClusterEventData() { } public System.Collections.Generic.IReadOnlyList InMaintenanceHostNames { get { throw null; } } public string OperationId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RemovedHostNames { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2874,7 +3301,10 @@ public partial class AvsClusterFailedEventData : Azure.Messaging.EventGrid.Syste { internal AvsClusterFailedEventData() { } public string FailureMessage { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2884,7 +3314,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsClusterUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterUpdatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2894,7 +3327,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsClusterUpdatingEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterUpdatingEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2905,7 +3341,10 @@ public partial class AvsPrivateCloudEventData : System.ClientModel.Primitives.IJ { internal AvsPrivateCloudEventData() { } public string OperationId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2916,7 +3355,10 @@ public partial class AvsPrivateCloudFailedEventData : Azure.Messaging.EventGrid. { internal AvsPrivateCloudFailedEventData() { } public string FailureMessage { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2926,7 +3368,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsPrivateCloudUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsPrivateCloudUpdatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2936,7 +3381,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsPrivateCloudUpdatingEventData : Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsPrivateCloudUpdatingEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2946,7 +3394,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsScriptExecutionCancelledEventData : Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsScriptExecutionCancelledEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionCancelledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionCancelledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2959,7 +3410,10 @@ internal AvsScriptExecutionEventData() { } public string CmdletId { get { throw null; } } public string OperationId { get { throw null; } } public System.Collections.Generic.IReadOnlyList Output { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2970,7 +3424,10 @@ public partial class AvsScriptExecutionFailedEventData : Azure.Messaging.EventGr { internal AvsScriptExecutionFailedEventData() { } public string FailureMessage { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2981,7 +3438,10 @@ public partial class AvsScriptExecutionFinishedEventData : Azure.Messaging.Event { internal AvsScriptExecutionFinishedEventData() { } public System.Collections.Generic.IReadOnlyDictionary NamedOutputs { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2991,7 +3451,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsScriptExecutionStartedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsScriptExecutionStartedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3020,6 +3483,7 @@ internal AzureMessagingEventGridSystemEventsContext() { } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel left, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel left, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel right) { throw null; } public override string ToString() { throw null; } } @@ -3032,7 +3496,10 @@ internal CommunicationIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } public string RawId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3043,7 +3510,10 @@ public partial class CommunicationUserIdentifierModel : System.ClientModel.Primi { internal CommunicationUserIdentifierModel() { } public string Id { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3059,7 +3529,10 @@ internal ContainerRegistryArtifactEventData() { } public string Location { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget Target { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3076,7 +3549,10 @@ internal ContainerRegistryArtifactEventTarget() { } public long? Size { get { throw null; } } public string Tag { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3086,7 +3562,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryChartDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryChartDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3096,7 +3575,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerRegistryChartPushedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryChartPushedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3107,7 +3589,10 @@ public partial class ContainerRegistryEventActor : System.ClientModel.Primitives { internal ContainerRegistryEventActor() { } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3118,7 +3603,10 @@ public partial class ContainerRegistryEventConnectedRegistry : System.ClientMode { internal ContainerRegistryEventConnectedRegistry() { } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3137,7 +3625,10 @@ internal ContainerRegistryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource Source { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget Target { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3152,7 +3643,10 @@ internal ContainerRegistryEventRequest() { } public string Id { get { throw null; } } public string Method { get { throw null; } } public string Useragent { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3164,7 +3658,10 @@ public partial class ContainerRegistryEventSource : System.ClientModel.Primitive internal ContainerRegistryEventSource() { } public string Addr { get { throw null; } } public string InstanceID { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3181,7 +3678,10 @@ internal ContainerRegistryEventTarget() { } public long? Size { get { throw null; } } public string Tag { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3191,7 +3691,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryImageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryImageDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3201,7 +3704,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerRegistryImagePushedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryImagePushedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3211,7 +3717,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceClusterSupportEndedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceClusterSupportEndedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3221,7 +3730,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceClusterSupportEndingEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceClusterSupportEndingEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3232,7 +3744,10 @@ public partial class ContainerServiceClusterSupportEventData : System.ClientMode { internal ContainerServiceClusterSupportEventData() { } public string KubernetesVersion { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3246,7 +3761,10 @@ internal ContainerServiceNewKubernetesVersionAvailableEventData() { } public string LatestStableKubernetesVersion { get { throw null; } } public string LatestSupportedKubernetesVersion { get { throw null; } } public string LowestMinorKubernetesVersion { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3257,7 +3775,10 @@ public partial class ContainerServiceNodePoolRollingEventData : System.ClientMod { internal ContainerServiceNodePoolRollingEventData() { } public string NodePoolName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3267,7 +3788,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerServiceNodePoolRollingFailedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceNodePoolRollingFailedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3277,7 +3801,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceNodePoolRollingStartedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceNodePoolRollingStartedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3287,7 +3814,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceNodePoolRollingSucceededEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceNodePoolRollingSucceededEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3300,7 +3830,10 @@ internal DataBoxCopyCompletedEventData() { } public string SerialNumber { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } public System.DateTimeOffset? StageTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3313,7 +3846,10 @@ internal DataBoxCopyStartedEventData() { } public string SerialNumber { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } public System.DateTimeOffset? StageTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3326,7 +3862,10 @@ internal DataBoxOrderCompletedEventData() { } public string SerialNumber { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } public System.DateTimeOffset? StageTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3349,6 +3888,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName left, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName left, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName right) { throw null; } public override string ToString() { throw null; } } @@ -3356,7 +3896,10 @@ public partial class DeviceConnectionStateEventInfo : System.ClientModel.Primiti { internal DeviceConnectionStateEventInfo() { } public string SequenceNumber { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3370,7 +3913,10 @@ internal DeviceConnectionStateEventProperties() { } public string DeviceId { get { throw null; } } public string HubName { get { throw null; } } public string ModuleId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3383,7 +3929,10 @@ internal DeviceLifeCycleEventProperties() { } public string DeviceId { get { throw null; } } public string HubName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo Twin { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3396,7 +3945,10 @@ internal DeviceTelemetryEventProperties() { } public object Body { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary SystemProperties { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3417,7 +3969,10 @@ internal DeviceTwinInfo() { } public string StatusUpdateTime { get { throw null; } } public float? Version { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint X509Thumbprint { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3429,7 +3984,10 @@ public partial class DeviceTwinInfoProperties : System.ClientModel.Primitives.IJ internal DeviceTwinInfoProperties() { } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties Desired { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties Reported { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3441,7 +3999,10 @@ public partial class DeviceTwinInfoX509Thumbprint : System.ClientModel.Primitive internal DeviceTwinInfoX509Thumbprint() { } public string PrimaryThumbprint { get { throw null; } } public string SecondaryThumbprint { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3452,7 +4013,10 @@ public partial class DeviceTwinMetadata : System.ClientModel.Primitives.IJsonMod { internal DeviceTwinMetadata() { } public string LastUpdated { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3464,7 +4028,10 @@ public partial class DeviceTwinProperties : System.ClientModel.Primitives.IJsonM internal DeviceTwinProperties() { } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata Metadata { get { throw null; } } public float? Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3481,7 +4048,10 @@ internal EdgeSolutionVersionPublishedEventData() { } public string SolutionTemplateVersionId { get { throw null; } } public string SolutionVersionId { get { throw null; } } public string TargetId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3495,7 +4065,10 @@ internal EventGridMqttClientCreatedOrUpdatedEventData() { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? State { get { throw null; } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3505,7 +4078,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal EventGridMqttClientDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3536,6 +4112,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public override string ToString() { throw null; } } @@ -3545,7 +4122,10 @@ internal EventGridMqttClientEventData() { } public string ClientAuthenticationName { get { throw null; } } public string ClientName { get { throw null; } } public string NamespaceName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3557,7 +4137,10 @@ public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messag internal EventGridMqttClientSessionConnectedEventData() { } public string ClientSessionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3570,7 +4153,10 @@ internal EventGridMqttClientSessionDisconnectedEventData() { } public string ClientSessionName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } public long? SequenceNumber { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3592,6 +4178,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public override string ToString() { throw null; } } @@ -3607,7 +4194,10 @@ internal EventHubCaptureFileCreatedEventData() { } public int? LastSequenceNumber { get { throw null; } } public string PartitionId { get { throw null; } } public int? SizeInBytes { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3623,7 +4213,10 @@ internal HealthcareDicomImageCreatedEventData() { } public string PartitionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } public string ServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3639,7 +4232,10 @@ internal HealthcareDicomImageDeletedEventData() { } public string PartitionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } public string ServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3655,7 +4251,10 @@ internal HealthcareDicomImageUpdatedEventData() { } public string PartitionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } public string ServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3669,7 +4268,10 @@ internal HealthcareFhirResourceCreatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3683,7 +4285,10 @@ internal HealthcareFhirResourceDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3864,6 +4469,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType left, Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType left, Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType right) { throw null; } public override string ToString() { throw null; } } @@ -3874,7 +4480,10 @@ internal HealthcareFhirResourceUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3884,7 +4493,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class IotHubDeviceConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceConnectedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3894,7 +4506,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceCreatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3904,7 +4519,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3914,7 +4532,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceDisconnectedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3924,7 +4545,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceTelemetryEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceTelemetryEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceTelemetryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceTelemetryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3941,7 +4565,10 @@ internal KeyVaultAccessPolicyChangedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3958,7 +4585,10 @@ internal KeyVaultCertificateExpiredEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3975,7 +4605,10 @@ internal KeyVaultCertificateNearExpiryEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3992,7 +4625,10 @@ internal KeyVaultCertificateNewVersionCreatedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4009,7 +4645,10 @@ internal KeyVaultKeyExpiredEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4026,7 +4665,10 @@ internal KeyVaultKeyNearExpiryEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4043,7 +4685,10 @@ internal KeyVaultKeyNewVersionCreatedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4060,7 +4705,10 @@ internal KeyVaultSecretExpiredEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4077,7 +4725,10 @@ internal KeyVaultSecretNearExpiryEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4094,7 +4745,10 @@ internal KeyVaultSecretNewVersionCreatedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4112,7 +4766,10 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() { } public string RunId { get { throw null; } } public System.DateTimeOffset? StartTime { get { throw null; } } public string TargetDatasetId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4127,7 +4784,10 @@ internal MachineLearningServicesModelDeployedEventData() { } public string ServiceName { get { throw null; } } public object ServiceProperties { get { throw null; } } public object ServiceTags { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4141,7 +4801,10 @@ internal MachineLearningServicesModelRegisteredEventData() { } public object ModelProperties { get { throw null; } } public object ModelTags { get { throw null; } } public string ModelVersion { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4157,7 +4820,10 @@ internal MachineLearningServicesRunCompletedEventData() { } public object RunProperties { get { throw null; } } public object RunTags { get { throw null; } } public string RunType { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4174,7 +4840,10 @@ internal MachineLearningServicesRunStatusChangedEventData() { } public string RunStatus { get { throw null; } } public object RunTags { get { throw null; } } public string RunType { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4184,7 +4853,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MapsGeofenceEnteredEventData : Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MapsGeofenceEnteredEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEnteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEnteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4198,7 +4870,10 @@ internal MapsGeofenceEventProperties() { } public System.Collections.Generic.IReadOnlyList Geometries { get { throw null; } } public System.Collections.Generic.IReadOnlyList InvalidPeriodGeofenceGeometryId { get { throw null; } } public bool? IsEventPublished { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4208,7 +4883,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MapsGeofenceExitedEventData : Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MapsGeofenceExitedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4224,7 +4902,10 @@ internal MapsGeofenceGeometry() { } public float? NearestLat { get { throw null; } } public float? NearestLon { get { throw null; } } public string UdId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4234,7 +4915,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MapsGeofenceResultEventData : Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MapsGeofenceResultEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4520,7 +5204,10 @@ internal MicrosoftTeamsUserIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } public bool? IsAnonymous { get { throw null; } } public string UserId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4531,7 +5218,10 @@ public partial class PhoneNumberIdentifierModel : System.ClientModel.Primitives. { internal PhoneNumberIdentifierModel() { } public string Value { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4548,7 +5238,10 @@ internal PolicyInsightsPolicyStateChangedEventData() { } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4565,7 +5258,10 @@ internal PolicyInsightsPolicyStateCreatedEventData() { } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4582,7 +5278,10 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4595,7 +5294,10 @@ internal RedisExportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4608,7 +5310,10 @@ internal RedisImportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4621,7 +5326,10 @@ internal RedisPatchingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4634,7 +5342,10 @@ internal RedisScalingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4661,7 +5372,10 @@ internal ResourceActionCancelEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4688,7 +5402,10 @@ internal ResourceActionFailureEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4715,7 +5432,10 @@ internal ResourceActionSuccessEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4728,7 +5448,10 @@ internal ResourceAuthorization() { } public string Action { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Evidence { get { throw null; } } public string Scope { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4755,7 +5478,10 @@ internal ResourceDeleteCancelEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4782,7 +5508,10 @@ internal ResourceDeleteFailureEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4809,7 +5538,10 @@ internal ResourceDeleteSuccessEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4823,7 +5555,10 @@ internal ResourceHttpRequest() { } public string ClientRequestId { get { throw null; } } public Azure.Core.RequestMethod Method { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4833,7 +5568,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4843,7 +5581,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsHealthResourcesAnnotatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4853,7 +5594,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4864,7 +5608,10 @@ public partial class ResourceNotificationsOperationalDetails : System.ClientMode { internal ResourceNotificationsOperationalDetails() { } public System.DateTimeOffset? ResourceEventTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4875,7 +5622,10 @@ public partial class ResourceNotificationsResourceDeletedDetails : System.Client { internal ResourceNotificationsResourceDeletedDetails() { } public Azure.Core.ResourceIdentifier Resource { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4887,7 +5637,10 @@ public partial class ResourceNotificationsResourceDeletedEventData : System.Clie internal ResourceNotificationsResourceDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails OperationalDetails { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceDetails { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4897,7 +5650,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4907,7 +5663,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsResourceManagementDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsResourceManagementDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4931,7 +5690,10 @@ internal ResourceNotificationsResourceUpdatedDetails() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This property will always be null. Use ResourceTags instead.")] public string Tags { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4944,7 +5706,10 @@ internal ResourceNotificationsResourceUpdatedEventData() { } public string ApiVersion { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails OperationalDetails { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails ResourceDetails { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4971,7 +5736,10 @@ internal ResourceWriteCancelEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4998,7 +5766,10 @@ internal ResourceWriteFailureEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5025,7 +5796,10 @@ internal ResourceWriteSuccessEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5041,7 +5815,10 @@ internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() { } public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5057,7 +5834,10 @@ internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() { } public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5073,7 +5853,10 @@ internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() { public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5089,7 +5872,10 @@ internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() { } public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5103,7 +5889,10 @@ internal SignalRServiceClientConnectionConnectedEventData() { } public string HubName { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5118,7 +5907,10 @@ internal SignalRServiceClientConnectionDisconnectedEventData() { } public string HubName { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5141,6 +5933,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StampKind left, Azure.Messaging.EventGrid.SystemEvents.StampKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StampKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StampKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StampKind left, Azure.Messaging.EventGrid.SystemEvents.StampKind right) { throw null; } public override string ToString() { throw null; } } @@ -5158,7 +5951,10 @@ internal StorageAsyncOperationInitiatedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5183,6 +5979,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } public override string ToString() { throw null; } } @@ -5203,7 +6000,10 @@ internal StorageBlobCreatedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5223,7 +6023,10 @@ internal StorageBlobDeletedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5240,7 +6043,10 @@ internal StorageBlobInventoryPolicyCompletedEventData() { } public string PolicyRunStatusMessage { get { throw null; } } public string RuleName { get { throw null; } } public System.DateTimeOffset? ScheduleDateTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5259,7 +6065,10 @@ internal StorageBlobRenamedEventData() { } public string SourceUrl { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5282,7 +6091,10 @@ internal StorageBlobTierChangedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5301,7 +6113,10 @@ internal StorageDirectoryCreatedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5320,7 +6135,10 @@ internal StorageDirectoryDeletedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5339,7 +6157,10 @@ internal StorageDirectoryRenamedEventData() { } public string SourceUrl { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5362,6 +6183,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } public override string ToString() { throw null; } } @@ -5371,7 +6193,10 @@ internal StorageLifecyclePolicyActionSummaryDetail() { } public string ErrorList { get { throw null; } } public long? SuccessCount { get { throw null; } } public long? TotalObjectsCount { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5387,7 +6212,10 @@ internal StorageLifecyclePolicyCompletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToArchiveSummary { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToColdSummary { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToCoolSummary { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5398,7 +6226,10 @@ public partial class StorageLifecyclePolicyRunSummary : System.ClientModel.Primi { internal StorageLifecyclePolicyRunSummary() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletionStatus { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5413,7 +6244,10 @@ internal StorageTaskAssignmentCompletedEventData() { } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5435,6 +6269,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus right) { throw null; } public override string ToString() { throw null; } } @@ -5443,7 +6278,10 @@ public partial class StorageTaskAssignmentQueuedEventData : System.ClientModel.P internal StorageTaskAssignmentQueuedEventData() { } public System.DateTimeOffset? QueuedOn { get { throw null; } } public string TaskExecutionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5458,7 +6296,10 @@ internal StorageTaskCompletedEventData() { } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5480,6 +6321,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus right) { throw null; } public override string ToString() { throw null; } } @@ -5488,7 +6330,10 @@ public partial class StorageTaskQueuedEventData : System.ClientModel.Primitives. internal StorageTaskQueuedEventData() { } public System.DateTimeOffset? QueuedDateTime { get { throw null; } } public string TaskExecutionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5499,7 +6344,10 @@ public partial class SubscriptionDeletedEventData : System.ClientModel.Primitive { internal SubscriptionDeletedEventData() { } public string EventSubscriptionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5511,7 +6359,10 @@ public partial class SubscriptionValidationEventData : System.ClientModel.Primit internal SubscriptionValidationEventData() { } public string ValidationCode { get { throw null; } } public string ValidationUrl { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5522,7 +6373,10 @@ public partial class SubscriptionValidationResponse : System.ClientModel.Primiti { public SubscriptionValidationResponse() { } public string ValidationResponse { get { throw null; } set { } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5540,7 +6394,10 @@ internal WebAppServicePlanUpdatedEventData() { } public string RequestId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku Sku { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5555,7 +6412,10 @@ internal WebAppServicePlanUpdatedEventDataSku() { } public string Name { get { throw null; } } public string Size { get { throw null; } } public string Tier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5572,7 +6432,10 @@ internal WebAppUpdatedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5589,7 +6452,10 @@ internal WebBackupOperationCompletedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5606,7 +6472,10 @@ internal WebBackupOperationFailedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5623,7 +6492,10 @@ internal WebBackupOperationStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5640,7 +6512,10 @@ internal WebRestoreOperationCompletedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5657,7 +6532,10 @@ internal WebRestoreOperationFailedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5674,7 +6552,10 @@ internal WebRestoreOperationStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5691,7 +6572,10 @@ internal WebSlotSwapCompletedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5708,7 +6592,10 @@ internal WebSlotSwapFailedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5725,7 +6612,10 @@ internal WebSlotSwapStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5742,7 +6632,10 @@ internal WebSlotSwapWithPreviewCancelledEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5759,7 +6652,10 @@ internal WebSlotSwapWithPreviewStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs index 8fba53de397d..bc122a85489d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs @@ -129,6 +129,7 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset? offeredOn = default(System.DateTimeOffset?), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? @operator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator?), object labelValue = null, double? ttlSeconds = default(double?), Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? selectorState = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState?), System.DateTimeOffset? expirationTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable updatedWorkerProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), string tag = null) { throw null; } @@ -365,10 +366,12 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData ResourceDeleteFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData ResourceDeleteSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, Azure.Core.RequestMethod? method = default(Azure.Core.RequestMethod?), string url = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string methodString = null, string url = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(Azure.Core.ResourceIdentifier resource = null, string name = null, string type = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData ResourceNotificationsResourceManagementDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; } @@ -398,6 +401,7 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, bool? recursive = default(bool?), string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, string recursiveString = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -812,6 +816,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind right) { throw null; } public override string ToString() { throw null; } } @@ -821,7 +826,10 @@ internal AcsCallEndedByProperties() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByKind? Kind { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -834,7 +842,10 @@ internal AcsCallEndedEventData() { } public System.TimeSpan? CallDuration { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedByProperties EndedBy { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties Reason { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -847,7 +858,10 @@ internal AcsCallEndReasonProperties() { } public int? Code { get { throw null; } } public string Phrase { get { throw null; } } public int? SubCode { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallEndReasonProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -858,7 +872,10 @@ public partial class AcsCallGroupProperties : System.ClientModel.Primitives.IJso { internal AcsCallGroupProperties() { } public string Id { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallGroupProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -875,7 +892,10 @@ internal AcsCallingEventProperties() { } public Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties Room { get { throw null; } } public string ServerCallId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties StartedBy { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -885,7 +905,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsCallParticipantAddedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsCallParticipantAddedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantAddedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantAddedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -899,7 +922,10 @@ internal AcsCallParticipantEventData() { } public string ParticipantId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties User { get { throw null; } } public string UserAgent { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -924,6 +950,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind right) { throw null; } public override string ToString() { throw null; } } @@ -932,7 +959,10 @@ public partial class AcsCallParticipantProperties : System.ClientModel.Primitive internal AcsCallParticipantProperties() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantKind? Role { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -942,7 +972,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsCallParticipantRemovedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsCallParticipantRemovedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantRemovedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallParticipantRemovedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -953,7 +986,10 @@ public partial class AcsCallRoomProperties : System.ClientModel.Primitives.IJson { internal AcsCallRoomProperties() { } public string Id { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallRoomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -963,7 +999,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsCallStartedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsCallStartedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsCallingEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsCallStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsCallStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -975,7 +1014,10 @@ public partial class AcsChatAzureBotCommandReceivedInThreadEventData : Azure.Mes internal AcsChatAzureBotCommandReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatAzureBotCommandReceivedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatAzureBotCommandReceivedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -988,7 +1030,10 @@ internal AcsChatEventBaseProperties() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RecipientCommunicationIdentifier { get { throw null; } } public string ThreadId { get { throw null; } } public string TransactionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1000,7 +1045,10 @@ public partial class AcsChatEventInThreadBaseProperties : System.ClientModel.Pri internal AcsChatEventInThreadBaseProperties() { } public string ThreadId { get { throw null; } } public string TransactionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1011,7 +1059,10 @@ public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid. { internal AcsChatMessageDeletedEventData() { } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1022,7 +1073,10 @@ public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.Ev { internal AcsChatMessageDeletedInThreadEventData() { } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1035,7 +1089,10 @@ internal AcsChatMessageEditedEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1048,7 +1105,10 @@ internal AcsChatMessageEditedInThreadEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1064,7 +1124,10 @@ internal AcsChatMessageEventBaseProperties() { } public string SenderDisplayName { get { throw null; } } public string Type { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1080,7 +1143,10 @@ internal AcsChatMessageEventInThreadBaseProperties() { } public string SenderDisplayName { get { throw null; } } public string Type { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1092,7 +1158,10 @@ public partial class AcsChatMessageReceivedEventData : Azure.Messaging.EventGrid internal AcsChatMessageReceivedEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1104,7 +1173,10 @@ public partial class AcsChatMessageReceivedInThreadEventData : Azure.Messaging.E internal AcsChatMessageReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1118,7 +1190,10 @@ internal AcsChatParticipantAddedToThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1131,7 +1206,10 @@ internal AcsChatParticipantAddedToThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1145,7 +1223,10 @@ internal AcsChatParticipantRemovedFromThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1158,7 +1239,10 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? Time { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1172,7 +1256,10 @@ internal AcsChatThreadCreatedEventData() { } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyList Participants { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1186,7 +1273,10 @@ internal AcsChatThreadCreatedWithUserEventData() { } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyList Participants { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1198,7 +1288,10 @@ public partial class AcsChatThreadDeletedEventData : Azure.Messaging.EventGrid.S internal AcsChatThreadDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1210,7 +1303,10 @@ public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGri internal AcsChatThreadEventBaseProperties() { } public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1222,7 +1318,10 @@ public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging. internal AcsChatThreadEventInThreadBaseProperties() { } public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1235,7 +1334,10 @@ internal AcsChatThreadParticipantProperties() { } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel ParticipantCommunicationIdentifier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1249,7 +1351,10 @@ internal AcsChatThreadPropertiesUpdatedEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1263,7 +1368,10 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1275,7 +1383,10 @@ public partial class AcsChatThreadWithUserDeletedEventData : Azure.Messaging.Eve internal AcsChatThreadWithUserDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? DeleteTime { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1287,7 +1398,10 @@ public partial class AcsChatTypingIndicatorReceivedInThreadEventData : Azure.Mes internal AcsChatTypingIndicatorReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsChatTypingIndicatorReceivedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatTypingIndicatorReceivedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1312,6 +1426,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind left, Azure.Messaging.EventGrid.SystemEvents.AcsCommunicationIdentifierKind right) { throw null; } public override string ToString() { throw null; } } @@ -1325,7 +1440,10 @@ internal AcsEmailDeliveryReportReceivedEventData() { } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? Status { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1351,6 +1469,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1359,7 +1478,10 @@ public partial class AcsEmailDeliveryReportStatusDetails : System.ClientModel.Pr internal AcsEmailDeliveryReportStatusDetails() { } public string RecipientMailServerHostName { get { throw null; } } public string StatusMessage { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1376,7 +1498,10 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() { } public string Sender { get { throw null; } } public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1388,7 +1513,10 @@ public partial class AcsIncomingCallCustomContext : System.ClientModel.Primitive internal AcsIncomingCallCustomContext() { } public System.Collections.Generic.IReadOnlyDictionary SipHeaders { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary VoipHeaders { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1406,7 +1534,10 @@ internal AcsIncomingCallEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel OnBehalfOfCallee { get { throw null; } } public string ServerCallId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel ToCommunicationIdentifier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1429,6 +1560,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind left, Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind left, Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind right) { throw null; } public override string ToString() { throw null; } } @@ -1437,7 +1569,10 @@ public partial class AcsMessageButtonContent : System.ClientModel.Primitives.IJs internal AcsMessageButtonContent() { } public string Payload { get { throw null; } } public string Text { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1458,6 +1593,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind right) { throw null; } public override string ToString() { throw null; } } @@ -1466,7 +1602,10 @@ public partial class AcsMessageContext : System.ClientModel.Primitives.IJsonMode internal AcsMessageContext() { } public string From { get { throw null; } } public string MessageId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1492,6 +1631,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1501,7 +1641,10 @@ internal AcsMessageDeliveryStatusUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? ChannelKind { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? Status { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1515,7 +1658,10 @@ internal AcsMessageEventData() { } public string From { get { throw null; } } public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string To { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1527,7 +1673,10 @@ public partial class AcsMessageInteractiveButtonReplyContent : System.ClientMode internal AcsMessageInteractiveButtonReplyContent() { } public string ButtonId { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1540,7 +1689,10 @@ internal AcsMessageInteractiveContent() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent ButtonReply { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent ListReply { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? ReplyKind { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1553,7 +1705,10 @@ internal AcsMessageInteractiveListReplyContent() { } public string Description { get { throw null; } } public string ListItemId { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1568,7 +1723,10 @@ internal AcsMessageMediaContent() { } public string FileName { get { throw null; } } public string MediaId { get { throw null; } } public string MimeType { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1580,7 +1738,10 @@ public partial class AcsMessageReactionContent : System.ClientModel.Primitives.I internal AcsMessageReactionContent() { } public string Emoji { get { throw null; } } public string MessageId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1599,7 +1760,10 @@ internal AcsMessageReceivedEventData() { } public string MessageId { get { throw null; } } public string MessageType { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageReactionContent Reaction { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1611,7 +1775,10 @@ public partial class AcsMicrosoftTeamsAppIdentifier : System.ClientModel.Primiti internal AcsMicrosoftTeamsAppIdentifier() { } public string AppId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMicrosoftTeamsAppIdentifier System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1633,6 +1800,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChannelType right) { throw null; } public override string ToString() { throw null; } } @@ -1645,7 +1813,10 @@ internal AcsRecordingChunkInfoProperties() { } public string EndReason { get { throw null; } } public long? Index { get { throw null; } } public string MetadataLocation { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1667,6 +1838,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingContentType right) { throw null; } public override string ToString() { throw null; } } @@ -1686,7 +1858,10 @@ internal AcsRecordingFileStatusUpdatedEventData() { } public System.DateTimeOffset? RecordingStartTime { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties RecordingStorageInfo { get { throw null; } } public string SessionEndReason { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1709,6 +1884,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFormatType right) { throw null; } public override string ToString() { throw null; } } @@ -1716,7 +1892,10 @@ public partial class AcsRecordingStorageInfoProperties : System.ClientModel.Prim { internal AcsRecordingStorageInfoProperties() { } public System.Collections.Generic.IReadOnlyList RecordingChunks { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1729,7 +1908,10 @@ internal AcsRouterChannelConfiguration() { } public int? CapacityCostPerJob { get { throw null; } } public string ChannelId { get { throw null; } } public int? MaxNumberOfJobs { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1742,7 +1924,10 @@ internal AcsRouterEventData() { } public string ChannelId { get { throw null; } } public string ChannelReference { get { throw null; } } public string JobId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1754,7 +1939,10 @@ public partial class AcsRouterJobCancelledEventData : Azure.Messaging.EventGrid. internal AcsRouterJobCancelledEventData() { } public string DispositionCode { get { throw null; } } public string Note { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCancelledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCancelledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1766,7 +1954,10 @@ public partial class AcsRouterJobClassificationFailedEventData : Azure.Messaging internal AcsRouterJobClassificationFailedEventData() { } public string ClassificationPolicyId { get { throw null; } } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassificationFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassificationFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1780,7 +1971,10 @@ internal AcsRouterJobClassifiedEventData() { } public string ClassificationPolicyId { get { throw null; } } public int? Priority { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails QueueDetails { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassifiedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassifiedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1793,7 +1987,10 @@ internal AcsRouterJobClosedEventData() { } public string AssignmentId { get { throw null; } } public string DispositionCode { get { throw null; } } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClosedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClosedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1805,7 +2002,10 @@ public partial class AcsRouterJobCompletedEventData : Azure.Messaging.EventGrid. internal AcsRouterJobCompletedEventData() { } public string AssignmentId { get { throw null; } } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1815,7 +2015,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsRouterJobDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterJobDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1828,7 +2031,10 @@ internal AcsRouterJobEventData() { } public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1840,7 +2046,10 @@ public partial class AcsRouterJobExceptionTriggeredEventData : Azure.Messaging.E internal AcsRouterJobExceptionTriggeredEventData() { } public string ExceptionRuleId { get { throw null; } } public string RuleKey { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1853,7 +2062,10 @@ internal AcsRouterJobQueuedEventData() { } public System.Collections.Generic.IReadOnlyList AttachedWorkerSelectors { get { throw null; } } public int? Priority { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1871,7 +2083,10 @@ internal AcsRouterJobReceivedEventData() { } public System.DateTimeOffset? ScheduledOn { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? Status { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1886,7 +2101,10 @@ internal AcsRouterJobSchedulingFailedEventData() { } public string FailureReason { get { throw null; } } public int? Priority { get { throw null; } } public System.DateTimeOffset? ScheduledOn { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1918,6 +2136,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus right) { throw null; } public override string ToString() { throw null; } } @@ -1926,7 +2145,10 @@ public partial class AcsRouterJobUnassignedEventData : Azure.Messaging.EventGrid internal AcsRouterJobUnassignedEventData() { } public string AssignmentId { get { throw null; } } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1941,7 +2163,10 @@ internal AcsRouterJobWaitingForActivationEventData() { } public int? Priority { get { throw null; } } public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1953,7 +2178,10 @@ public partial class AcsRouterJobWorkerSelectorsExpiredEventData : Azure.Messagi internal AcsRouterJobWorkerSelectorsExpiredEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1979,6 +2207,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator right) { throw null; } public override string ToString() { throw null; } } @@ -1988,7 +2217,10 @@ internal AcsRouterQueueDetails() { } public string Id { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2014,13 +2246,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty right) { throw null; } public override string ToString() { throw null; } } public partial class AcsRouterWorkerDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2031,7 +2267,10 @@ public partial class AcsRouterWorkerDeregisteredEventData : System.ClientModel.P { internal AcsRouterWorkerDeregisteredEventData() { } public string WorkerId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2042,7 +2281,10 @@ public partial class AcsRouterWorkerEventData : Azure.Messaging.EventGrid.System { internal AcsRouterWorkerEventData() { } public string WorkerId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2060,7 +2302,10 @@ internal AcsRouterWorkerOfferAcceptedEventData() { } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerTags { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2072,7 +2317,10 @@ public partial class AcsRouterWorkerOfferDeclinedEventData : Azure.Messaging.Eve internal AcsRouterWorkerOfferDeclinedEventData() { } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2084,7 +2332,10 @@ public partial class AcsRouterWorkerOfferExpiredEventData : Azure.Messaging.Even internal AcsRouterWorkerOfferExpiredEventData() { } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2103,7 +2354,10 @@ internal AcsRouterWorkerOfferIssuedEventData() { } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerTags { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2115,7 +2369,10 @@ public partial class AcsRouterWorkerOfferRevokedEventData : Azure.Messaging.Even internal AcsRouterWorkerOfferRevokedEventData() { } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2131,7 +2388,10 @@ internal AcsRouterWorkerRegisteredEventData() { } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } public int? TotalCapacity { get { throw null; } } public string WorkerId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2151,7 +2411,10 @@ internal AcsRouterWorkerSelector() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState? State { get { throw null; } } public System.TimeSpan? TimeToLive { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2173,6 +2436,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState left, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState right) { throw null; } public override string ToString() { throw null; } } @@ -2186,7 +2450,10 @@ internal AcsRouterWorkerUpdatedEventData() { } public int? TotalCapacity { get { throw null; } } public System.Collections.Generic.IReadOnlyList UpdatedWorkerProperties { get { throw null; } } public string WorkerId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2199,7 +2466,10 @@ internal AcsSmsDeliveryAttemptProperties() { } public int? SegmentsFailed { get { throw null; } } public int? SegmentsSucceeded { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2214,7 +2484,10 @@ internal AcsSmsDeliveryReportReceivedEventData() { } public string DeliveryStatusDetails { get { throw null; } } public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string Tag { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2227,7 +2500,10 @@ internal AcsSmsEventBaseProperties() { } public string From { get { throw null; } } public string MessageId { get { throw null; } } public string To { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2240,7 +2516,10 @@ internal AcsSmsReceivedEventData() { } public string Message { get { throw null; } } public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public int SegmentCount { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2251,7 +2530,10 @@ public partial class AcsUserDisconnectedEventData : System.ClientModel.Primitive { internal AcsUserDisconnectedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel UserCommunicationIdentifier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2273,6 +2555,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement left, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement left, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement right) { throw null; } public override string ToString() { throw null; } } @@ -2282,7 +2565,10 @@ internal ApiCenterApiDefinitionAddedEventData() { } public string Description { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification Specification { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2295,7 +2581,10 @@ internal ApiCenterApiDefinitionUpdatedEventData() { } public string Description { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification Specification { get { throw null; } } public string Title { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2307,7 +2596,10 @@ public partial class ApiCenterApiSpecification : System.ClientModel.Primitives.I internal ApiCenterApiSpecification() { } public string Name { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2318,7 +2610,10 @@ public partial class ApiManagementApiCreatedEventData : System.ClientModel.Primi { internal ApiManagementApiCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2329,7 +2624,10 @@ public partial class ApiManagementApiDeletedEventData : System.ClientModel.Primi { internal ApiManagementApiDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2340,7 +2638,10 @@ public partial class ApiManagementApiReleaseCreatedEventData : System.ClientMode { internal ApiManagementApiReleaseCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2351,7 +2652,10 @@ public partial class ApiManagementApiReleaseDeletedEventData : System.ClientMode { internal ApiManagementApiReleaseDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2362,7 +2666,10 @@ public partial class ApiManagementApiReleaseUpdatedEventData : System.ClientMode { internal ApiManagementApiReleaseUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2373,7 +2680,10 @@ public partial class ApiManagementApiUpdatedEventData : System.ClientModel.Primi { internal ApiManagementApiUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2385,7 +2695,10 @@ public partial class ApiManagementCircuitBreakerClosedEventData : System.ClientM internal ApiManagementCircuitBreakerClosedEventData() { } public string BackendName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties CircuitBreaker { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerClosedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2397,7 +2710,10 @@ public partial class ApiManagementCircuitBreakerOpenedEventData : System.ClientM internal ApiManagementCircuitBreakerOpenedEventData() { } public string BackendName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties CircuitBreaker { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerOpenedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2408,7 +2724,10 @@ public partial class ApiManagementCircuitBreakerProperties : System.ClientModel. { internal ApiManagementCircuitBreakerProperties() { } public System.Collections.Generic.IReadOnlyDictionary Rules { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementCircuitBreakerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2419,7 +2738,10 @@ public partial class ApiManagementExpiredGatewayTokenProperties : System.ClientM { internal ApiManagementExpiredGatewayTokenProperties() { } public System.DateTimeOffset? ExpiresOn { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2430,7 +2752,10 @@ public partial class ApiManagementGatewayApiAddedEventData : System.ClientModel. { internal ApiManagementGatewayApiAddedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2441,7 +2766,10 @@ public partial class ApiManagementGatewayApiRemovedEventData : System.ClientMode { internal ApiManagementGatewayApiRemovedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2452,7 +2780,10 @@ public partial class ApiManagementGatewayCertificateAuthorityCreatedEventData : { internal ApiManagementGatewayCertificateAuthorityCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2463,7 +2794,10 @@ public partial class ApiManagementGatewayCertificateAuthorityDeletedEventData : { internal ApiManagementGatewayCertificateAuthorityDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2474,7 +2808,10 @@ public partial class ApiManagementGatewayCertificateAuthorityUpdatedEventData : { internal ApiManagementGatewayCertificateAuthorityUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2485,7 +2822,10 @@ public partial class ApiManagementGatewayCreatedEventData : System.ClientModel.P { internal ApiManagementGatewayCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2496,7 +2836,10 @@ public partial class ApiManagementGatewayDeletedEventData : System.ClientModel.P { internal ApiManagementGatewayDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2507,7 +2850,10 @@ public partial class ApiManagementGatewayHostnameConfigurationCreatedEventData : { internal ApiManagementGatewayHostnameConfigurationCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2518,7 +2864,10 @@ public partial class ApiManagementGatewayHostnameConfigurationDeletedEventData : { internal ApiManagementGatewayHostnameConfigurationDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2529,7 +2878,10 @@ public partial class ApiManagementGatewayHostnameConfigurationUpdatedEventData : { internal ApiManagementGatewayHostnameConfigurationUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2541,7 +2893,10 @@ public partial class ApiManagementGatewayProperties : System.ClientModel.Primiti internal ApiManagementGatewayProperties() { } public string GatewayId { get { throw null; } } public string InstanceId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2553,7 +2908,10 @@ public partial class ApiManagementGatewayTokenExpiredEventData : System.ClientMo internal ApiManagementGatewayTokenExpiredEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties Gateway { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementExpiredGatewayTokenProperties Token { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2565,7 +2923,10 @@ public partial class ApiManagementGatewayTokenNearExpiryEventData : System.Clien internal ApiManagementGatewayTokenNearExpiryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayProperties Gateway { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties Token { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2576,7 +2937,10 @@ public partial class ApiManagementGatewayTokenNearExpiryProperties : System.Clie { internal ApiManagementGatewayTokenNearExpiryProperties() { } public System.DateTimeOffset? ExpiresOn { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayTokenNearExpiryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2587,7 +2951,10 @@ public partial class ApiManagementGatewayUpdatedEventData : System.ClientModel.P { internal ApiManagementGatewayUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2598,7 +2965,10 @@ public partial class ApiManagementProductCreatedEventData : System.ClientModel.P { internal ApiManagementProductCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2609,7 +2979,10 @@ public partial class ApiManagementProductDeletedEventData : System.ClientModel.P { internal ApiManagementProductDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2620,7 +2993,10 @@ public partial class ApiManagementProductUpdatedEventData : System.ClientModel.P { internal ApiManagementProductUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2631,7 +3007,10 @@ public partial class ApiManagementSubscriptionCreatedEventData : System.ClientMo { internal ApiManagementSubscriptionCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2642,7 +3021,10 @@ public partial class ApiManagementSubscriptionDeletedEventData : System.ClientMo { internal ApiManagementSubscriptionDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2653,7 +3035,10 @@ public partial class ApiManagementSubscriptionUpdatedEventData : System.ClientMo { internal ApiManagementSubscriptionUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2664,7 +3049,10 @@ public partial class ApiManagementUserCreatedEventData : System.ClientModel.Prim { internal ApiManagementUserCreatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2675,7 +3063,10 @@ public partial class ApiManagementUserDeletedEventData : System.ClientModel.Prim { internal ApiManagementUserDeletedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2686,7 +3077,10 @@ public partial class ApiManagementUserUpdatedEventData : System.ClientModel.Prim { internal ApiManagementUserUpdatedEventData() { } public string ResourceUri { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2712,6 +3106,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AppAction left, Azure.Messaging.EventGrid.SystemEvents.AppAction right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppAction (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppAction? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AppAction left, Azure.Messaging.EventGrid.SystemEvents.AppAction right) { throw null; } public override string ToString() { throw null; } } @@ -2722,7 +3117,10 @@ internal AppConfigurationKeyValueDeletedEventData() { } public string Key { get { throw null; } } public string Label { get { throw null; } } public string SyncToken { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2736,7 +3134,10 @@ internal AppConfigurationKeyValueModifiedEventData() { } public string Key { get { throw null; } } public string Label { get { throw null; } } public string SyncToken { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2746,7 +3147,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppConfigurationSnapshotCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppConfigurationSnapshotCreatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2759,7 +3163,10 @@ internal AppConfigurationSnapshotEventData() { } public string ETag { get { throw null; } } public string Name { get { throw null; } } public string SyncToken { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2769,7 +3176,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppConfigurationSnapshotModifiedEventData : Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppConfigurationSnapshotModifiedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2780,7 +3190,10 @@ public partial class AppEventTypeDetail : System.ClientModel.Primitives.IJsonMod { internal AppEventTypeDetail() { } public Azure.Messaging.EventGrid.SystemEvents.AppAction? Action { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2801,6 +3214,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction left, Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction left, Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction right) { throw null; } public override string ToString() { throw null; } } @@ -2810,7 +3224,10 @@ internal AppServicePlanEventTypeDetail() { } public Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? Action { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StampKind? StampKind { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? Status { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2833,13 +3250,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus left, Azure.Messaging.EventGrid.SystemEvents.AsyncStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AsyncStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus left, Azure.Messaging.EventGrid.SystemEvents.AsyncStatus right) { throw null; } public override string ToString() { throw null; } } public partial class AvsClusterCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterCreatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2849,7 +3270,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsClusterDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2863,7 +3287,10 @@ internal AvsClusterEventData() { } public System.Collections.Generic.IReadOnlyList InMaintenanceHostNames { get { throw null; } } public string OperationId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RemovedHostNames { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2874,7 +3301,10 @@ public partial class AvsClusterFailedEventData : Azure.Messaging.EventGrid.Syste { internal AvsClusterFailedEventData() { } public string FailureMessage { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2884,7 +3314,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsClusterUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterUpdatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2894,7 +3327,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsClusterUpdatingEventData : Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsClusterUpdatingEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsClusterUpdatingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2905,7 +3341,10 @@ public partial class AvsPrivateCloudEventData : System.ClientModel.Primitives.IJ { internal AvsPrivateCloudEventData() { } public string OperationId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2916,7 +3355,10 @@ public partial class AvsPrivateCloudFailedEventData : Azure.Messaging.EventGrid. { internal AvsPrivateCloudFailedEventData() { } public string FailureMessage { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2926,7 +3368,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsPrivateCloudUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsPrivateCloudUpdatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2936,7 +3381,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsPrivateCloudUpdatingEventData : Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsPrivateCloudUpdatingEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsPrivateCloudUpdatingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2946,7 +3394,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsScriptExecutionCancelledEventData : Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsScriptExecutionCancelledEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionCancelledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionCancelledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2959,7 +3410,10 @@ internal AvsScriptExecutionEventData() { } public string CmdletId { get { throw null; } } public string OperationId { get { throw null; } } public System.Collections.Generic.IReadOnlyList Output { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2970,7 +3424,10 @@ public partial class AvsScriptExecutionFailedEventData : Azure.Messaging.EventGr { internal AvsScriptExecutionFailedEventData() { } public string FailureMessage { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2981,7 +3438,10 @@ public partial class AvsScriptExecutionFinishedEventData : Azure.Messaging.Event { internal AvsScriptExecutionFinishedEventData() { } public System.Collections.Generic.IReadOnlyDictionary NamedOutputs { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2991,7 +3451,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AvsScriptExecutionStartedEventData : Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AvsScriptExecutionStartedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3020,6 +3483,7 @@ internal AzureMessagingEventGridSystemEventsContext() { } public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel left, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel left, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel right) { throw null; } public override string ToString() { throw null; } } @@ -3032,7 +3496,10 @@ internal CommunicationIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } public string RawId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3043,7 +3510,10 @@ public partial class CommunicationUserIdentifierModel : System.ClientModel.Primi { internal CommunicationUserIdentifierModel() { } public string Id { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3059,7 +3529,10 @@ internal ContainerRegistryArtifactEventData() { } public string Location { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget Target { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3076,7 +3549,10 @@ internal ContainerRegistryArtifactEventTarget() { } public long? Size { get { throw null; } } public string Tag { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3086,7 +3562,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryChartDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryChartDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3096,7 +3575,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerRegistryChartPushedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryChartPushedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3107,7 +3589,10 @@ public partial class ContainerRegistryEventActor : System.ClientModel.Primitives { internal ContainerRegistryEventActor() { } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3118,7 +3603,10 @@ public partial class ContainerRegistryEventConnectedRegistry : System.ClientMode { internal ContainerRegistryEventConnectedRegistry() { } public string Name { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3137,7 +3625,10 @@ internal ContainerRegistryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource Source { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget Target { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3152,7 +3643,10 @@ internal ContainerRegistryEventRequest() { } public string Id { get { throw null; } } public string Method { get { throw null; } } public string Useragent { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3164,7 +3658,10 @@ public partial class ContainerRegistryEventSource : System.ClientModel.Primitive internal ContainerRegistryEventSource() { } public string Addr { get { throw null; } } public string InstanceID { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3181,7 +3678,10 @@ internal ContainerRegistryEventTarget() { } public long? Size { get { throw null; } } public string Tag { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3191,7 +3691,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerRegistryImageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryImageDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3201,7 +3704,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerRegistryImagePushedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerRegistryImagePushedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3211,7 +3717,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceClusterSupportEndedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceClusterSupportEndedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3221,7 +3730,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceClusterSupportEndingEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceClusterSupportEndingEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3232,7 +3744,10 @@ public partial class ContainerServiceClusterSupportEventData : System.ClientMode { internal ContainerServiceClusterSupportEventData() { } public string KubernetesVersion { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3246,7 +3761,10 @@ internal ContainerServiceNewKubernetesVersionAvailableEventData() { } public string LatestStableKubernetesVersion { get { throw null; } } public string LatestSupportedKubernetesVersion { get { throw null; } } public string LowestMinorKubernetesVersion { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNewKubernetesVersionAvailableEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3257,7 +3775,10 @@ public partial class ContainerServiceNodePoolRollingEventData : System.ClientMod { internal ContainerServiceNodePoolRollingEventData() { } public string NodePoolName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3267,7 +3788,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerServiceNodePoolRollingFailedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceNodePoolRollingFailedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3277,7 +3801,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceNodePoolRollingStartedEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceNodePoolRollingStartedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3287,7 +3814,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ContainerServiceNodePoolRollingSucceededEventData : Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerServiceNodePoolRollingSucceededEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3300,7 +3830,10 @@ internal DataBoxCopyCompletedEventData() { } public string SerialNumber { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } public System.DateTimeOffset? StageTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3313,7 +3846,10 @@ internal DataBoxCopyStartedEventData() { } public string SerialNumber { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } public System.DateTimeOffset? StageTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3326,7 +3862,10 @@ internal DataBoxOrderCompletedEventData() { } public string SerialNumber { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } public System.DateTimeOffset? StageTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3349,6 +3888,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName left, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName left, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName right) { throw null; } public override string ToString() { throw null; } } @@ -3356,7 +3896,10 @@ public partial class DeviceConnectionStateEventInfo : System.ClientModel.Primiti { internal DeviceConnectionStateEventInfo() { } public string SequenceNumber { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3370,7 +3913,10 @@ internal DeviceConnectionStateEventProperties() { } public string DeviceId { get { throw null; } } public string HubName { get { throw null; } } public string ModuleId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3383,7 +3929,10 @@ internal DeviceLifeCycleEventProperties() { } public string DeviceId { get { throw null; } } public string HubName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo Twin { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3396,7 +3945,10 @@ internal DeviceTelemetryEventProperties() { } public object Body { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary SystemProperties { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3417,7 +3969,10 @@ internal DeviceTwinInfo() { } public string StatusUpdateTime { get { throw null; } } public float? Version { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint X509Thumbprint { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3429,7 +3984,10 @@ public partial class DeviceTwinInfoProperties : System.ClientModel.Primitives.IJ internal DeviceTwinInfoProperties() { } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties Desired { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties Reported { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3441,7 +3999,10 @@ public partial class DeviceTwinInfoX509Thumbprint : System.ClientModel.Primitive internal DeviceTwinInfoX509Thumbprint() { } public string PrimaryThumbprint { get { throw null; } } public string SecondaryThumbprint { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3452,7 +4013,10 @@ public partial class DeviceTwinMetadata : System.ClientModel.Primitives.IJsonMod { internal DeviceTwinMetadata() { } public string LastUpdated { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3464,7 +4028,10 @@ public partial class DeviceTwinProperties : System.ClientModel.Primitives.IJsonM internal DeviceTwinProperties() { } public Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata Metadata { get { throw null; } } public float? Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3481,7 +4048,10 @@ internal EdgeSolutionVersionPublishedEventData() { } public string SolutionTemplateVersionId { get { throw null; } } public string SolutionVersionId { get { throw null; } } public string TargetId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EdgeSolutionVersionPublishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3495,7 +4065,10 @@ internal EventGridMqttClientCreatedOrUpdatedEventData() { } public System.DateTimeOffset? CreatedOn { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? State { get { throw null; } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3505,7 +4078,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal EventGridMqttClientDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3536,6 +4112,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public override string ToString() { throw null; } } @@ -3545,7 +4122,10 @@ internal EventGridMqttClientEventData() { } public string ClientAuthenticationName { get { throw null; } } public string ClientName { get { throw null; } } public string NamespaceName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3557,7 +4137,10 @@ public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messag internal EventGridMqttClientSessionConnectedEventData() { } public string ClientSessionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3570,7 +4153,10 @@ internal EventGridMqttClientSessionDisconnectedEventData() { } public string ClientSessionName { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } public long? SequenceNumber { get { throw null; } } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3592,6 +4178,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public override string ToString() { throw null; } } @@ -3607,7 +4194,10 @@ internal EventHubCaptureFileCreatedEventData() { } public int? LastSequenceNumber { get { throw null; } } public string PartitionId { get { throw null; } } public int? SizeInBytes { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3623,7 +4213,10 @@ internal HealthcareDicomImageCreatedEventData() { } public string PartitionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } public string ServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3639,7 +4232,10 @@ internal HealthcareDicomImageDeletedEventData() { } public string PartitionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } public string ServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3655,7 +4251,10 @@ internal HealthcareDicomImageUpdatedEventData() { } public string PartitionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } public string ServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3669,7 +4268,10 @@ internal HealthcareFhirResourceCreatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3683,7 +4285,10 @@ internal HealthcareFhirResourceDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3864,6 +4469,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType left, Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType left, Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType right) { throw null; } public override string ToString() { throw null; } } @@ -3874,7 +4480,10 @@ internal HealthcareFhirResourceUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3884,7 +4493,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class IotHubDeviceConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceConnectedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3894,7 +4506,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceCreatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3904,7 +4519,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3914,7 +4532,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceDisconnectedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3924,7 +4545,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class IotHubDeviceTelemetryEventData : Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal IotHubDeviceTelemetryEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.DeviceTelemetryEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceTelemetryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceTelemetryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3941,7 +4565,10 @@ internal KeyVaultAccessPolicyChangedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultAccessPolicyChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3958,7 +4585,10 @@ internal KeyVaultCertificateExpiredEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3975,7 +4605,10 @@ internal KeyVaultCertificateNearExpiryEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3992,7 +4625,10 @@ internal KeyVaultCertificateNewVersionCreatedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultCertificateNewVersionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4009,7 +4645,10 @@ internal KeyVaultKeyExpiredEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4026,7 +4665,10 @@ internal KeyVaultKeyNearExpiryEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4043,7 +4685,10 @@ internal KeyVaultKeyNewVersionCreatedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultKeyNewVersionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4060,7 +4705,10 @@ internal KeyVaultSecretExpiredEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4077,7 +4725,10 @@ internal KeyVaultSecretNearExpiryEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4094,7 +4745,10 @@ internal KeyVaultSecretNewVersionCreatedEventData() { } public string ObjectType { get { throw null; } } public string VaultName { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4112,7 +4766,10 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() { } public string RunId { get { throw null; } } public System.DateTimeOffset? StartTime { get { throw null; } } public string TargetDatasetId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4127,7 +4784,10 @@ internal MachineLearningServicesModelDeployedEventData() { } public string ServiceName { get { throw null; } } public object ServiceProperties { get { throw null; } } public object ServiceTags { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4141,7 +4801,10 @@ internal MachineLearningServicesModelRegisteredEventData() { } public object ModelProperties { get { throw null; } } public object ModelTags { get { throw null; } } public string ModelVersion { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4157,7 +4820,10 @@ internal MachineLearningServicesRunCompletedEventData() { } public object RunProperties { get { throw null; } } public object RunTags { get { throw null; } } public string RunType { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4174,7 +4840,10 @@ internal MachineLearningServicesRunStatusChangedEventData() { } public string RunStatus { get { throw null; } } public object RunTags { get { throw null; } } public string RunType { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunStatusChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4184,7 +4853,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MapsGeofenceEnteredEventData : Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MapsGeofenceEnteredEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEnteredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEnteredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4198,7 +4870,10 @@ internal MapsGeofenceEventProperties() { } public System.Collections.Generic.IReadOnlyList Geometries { get { throw null; } } public System.Collections.Generic.IReadOnlyList InvalidPeriodGeofenceGeometryId { get { throw null; } } public bool? IsEventPublished { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4208,7 +4883,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MapsGeofenceExitedEventData : Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MapsGeofenceExitedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4224,7 +4902,10 @@ internal MapsGeofenceGeometry() { } public float? NearestLat { get { throw null; } } public float? NearestLon { get { throw null; } } public string UdId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4234,7 +4915,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MapsGeofenceResultEventData : Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MapsGeofenceResultEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4520,7 +5204,10 @@ internal MicrosoftTeamsUserIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } public bool? IsAnonymous { get { throw null; } } public string UserId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4531,7 +5218,10 @@ public partial class PhoneNumberIdentifierModel : System.ClientModel.Primitives. { internal PhoneNumberIdentifierModel() { } public string Value { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4548,7 +5238,10 @@ internal PolicyInsightsPolicyStateChangedEventData() { } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4565,7 +5258,10 @@ internal PolicyInsightsPolicyStateCreatedEventData() { } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4582,7 +5278,10 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4595,7 +5294,10 @@ internal RedisExportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4608,7 +5310,10 @@ internal RedisImportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4621,7 +5326,10 @@ internal RedisPatchingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4634,7 +5342,10 @@ internal RedisScalingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4661,7 +5372,10 @@ internal ResourceActionCancelEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4688,7 +5402,10 @@ internal ResourceActionFailureEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4715,7 +5432,10 @@ internal ResourceActionSuccessEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4728,7 +5448,10 @@ internal ResourceAuthorization() { } public string Action { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Evidence { get { throw null; } } public string Scope { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4755,7 +5478,10 @@ internal ResourceDeleteCancelEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteCancelEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4782,7 +5508,10 @@ internal ResourceDeleteFailureEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4809,7 +5538,10 @@ internal ResourceDeleteSuccessEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4823,7 +5555,10 @@ internal ResourceHttpRequest() { } public string ClientRequestId { get { throw null; } } public Azure.Core.RequestMethod Method { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4833,7 +5568,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4843,7 +5581,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsHealthResourcesAnnotatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4853,7 +5594,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4864,7 +5608,10 @@ public partial class ResourceNotificationsOperationalDetails : System.ClientMode { internal ResourceNotificationsOperationalDetails() { } public System.DateTimeOffset? ResourceEventTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4875,7 +5622,10 @@ public partial class ResourceNotificationsResourceDeletedDetails : System.Client { internal ResourceNotificationsResourceDeletedDetails() { } public Azure.Core.ResourceIdentifier Resource { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4887,7 +5637,10 @@ public partial class ResourceNotificationsResourceDeletedEventData : System.Clie internal ResourceNotificationsResourceDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails OperationalDetails { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceDetails { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4897,7 +5650,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4907,7 +5663,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsResourceManagementDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsResourceManagementDeletedEventData() { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4931,7 +5690,10 @@ internal ResourceNotificationsResourceUpdatedDetails() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This property will always be null. Use ResourceTags instead.")] public string Tags { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4944,7 +5706,10 @@ internal ResourceNotificationsResourceUpdatedEventData() { } public string ApiVersion { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails OperationalDetails { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails ResourceDetails { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4971,7 +5736,10 @@ internal ResourceWriteCancelEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteCancelEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4998,7 +5766,10 @@ internal ResourceWriteFailureEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteFailureEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5025,7 +5796,10 @@ internal ResourceWriteSuccessEventData() { } public string Status { get { throw null; } } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceWriteSuccessEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5041,7 +5815,10 @@ internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() { } public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5057,7 +5834,10 @@ internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() { } public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5073,7 +5853,10 @@ internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() { public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5089,7 +5872,10 @@ internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() { } public string RequestUri { get { throw null; } } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5103,7 +5889,10 @@ internal SignalRServiceClientConnectionConnectedEventData() { } public string HubName { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5118,7 +5907,10 @@ internal SignalRServiceClientConnectionDisconnectedEventData() { } public string HubName { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5141,6 +5933,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StampKind left, Azure.Messaging.EventGrid.SystemEvents.StampKind right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StampKind (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StampKind? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StampKind left, Azure.Messaging.EventGrid.SystemEvents.StampKind right) { throw null; } public override string ToString() { throw null; } } @@ -5158,7 +5951,10 @@ internal StorageAsyncOperationInitiatedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5183,6 +5979,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } public override string ToString() { throw null; } } @@ -5203,7 +6000,10 @@ internal StorageBlobCreatedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5223,7 +6023,10 @@ internal StorageBlobDeletedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5240,7 +6043,10 @@ internal StorageBlobInventoryPolicyCompletedEventData() { } public string PolicyRunStatusMessage { get { throw null; } } public string RuleName { get { throw null; } } public System.DateTimeOffset? ScheduleDateTime { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5259,7 +6065,10 @@ internal StorageBlobRenamedEventData() { } public string SourceUrl { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5282,7 +6091,10 @@ internal StorageBlobTierChangedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5301,7 +6113,10 @@ internal StorageDirectoryCreatedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5320,7 +6135,10 @@ internal StorageDirectoryDeletedEventData() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5339,7 +6157,10 @@ internal StorageDirectoryRenamedEventData() { } public string SourceUrl { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public object StorageDiagnostics { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5362,6 +6183,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } public override string ToString() { throw null; } } @@ -5371,7 +6193,10 @@ internal StorageLifecyclePolicyActionSummaryDetail() { } public string ErrorList { get { throw null; } } public long? SuccessCount { get { throw null; } } public long? TotalObjectsCount { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5387,7 +6212,10 @@ internal StorageLifecyclePolicyCompletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToArchiveSummary { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToColdSummary { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToCoolSummary { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5398,7 +6226,10 @@ public partial class StorageLifecyclePolicyRunSummary : System.ClientModel.Primi { internal StorageLifecyclePolicyRunSummary() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletionStatus { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5413,7 +6244,10 @@ internal StorageTaskAssignmentCompletedEventData() { } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5435,6 +6269,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus right) { throw null; } public override string ToString() { throw null; } } @@ -5443,7 +6278,10 @@ public partial class StorageTaskAssignmentQueuedEventData : System.ClientModel.P internal StorageTaskAssignmentQueuedEventData() { } public System.DateTimeOffset? QueuedOn { get { throw null; } } public string TaskExecutionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5458,7 +6296,10 @@ internal StorageTaskCompletedEventData() { } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5480,6 +6321,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus right) { throw null; } public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus (string value) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? (string value) { throw null; } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus right) { throw null; } public override string ToString() { throw null; } } @@ -5488,7 +6330,10 @@ public partial class StorageTaskQueuedEventData : System.ClientModel.Primitives. internal StorageTaskQueuedEventData() { } public System.DateTimeOffset? QueuedDateTime { get { throw null; } } public string TaskExecutionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5499,7 +6344,10 @@ public partial class SubscriptionDeletedEventData : System.ClientModel.Primitive { internal SubscriptionDeletedEventData() { } public string EventSubscriptionId { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5511,7 +6359,10 @@ public partial class SubscriptionValidationEventData : System.ClientModel.Primit internal SubscriptionValidationEventData() { } public string ValidationCode { get { throw null; } } public string ValidationUrl { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5522,7 +6373,10 @@ public partial class SubscriptionValidationResponse : System.ClientModel.Primiti { public SubscriptionValidationResponse() { } public string ValidationResponse { get { throw null; } set { } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5540,7 +6394,10 @@ internal WebAppServicePlanUpdatedEventData() { } public string RequestId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku Sku { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5555,7 +6412,10 @@ internal WebAppServicePlanUpdatedEventDataSku() { } public string Name { get { throw null; } } public string Size { get { throw null; } } public string Tier { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebAppServicePlanUpdatedEventDataSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5572,7 +6432,10 @@ internal WebAppUpdatedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebAppUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5589,7 +6452,10 @@ internal WebBackupOperationCompletedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5606,7 +6472,10 @@ internal WebBackupOperationFailedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5623,7 +6492,10 @@ internal WebBackupOperationStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebBackupOperationStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5640,7 +6512,10 @@ internal WebRestoreOperationCompletedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5657,7 +6532,10 @@ internal WebRestoreOperationFailedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5674,7 +6552,10 @@ internal WebRestoreOperationStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebRestoreOperationStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5691,7 +6572,10 @@ internal WebSlotSwapCompletedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5708,7 +6592,10 @@ internal WebSlotSwapFailedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5725,7 +6612,10 @@ internal WebSlotSwapStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5742,7 +6632,10 @@ internal WebSlotSwapWithPreviewCancelledEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewCancelledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5759,7 +6652,10 @@ internal WebSlotSwapWithPreviewStartedEventData() { } public string Name { get { throw null; } } public string RequestId { get { throw null; } } public string Verb { get { throw null; } } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.WebSlotSwapWithPreviewStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } From 9fb6fc22815ff441d71f01c1b87bc2ad9a0a6e31 Mon Sep 17 00:00:00 2001 From: jolov Date: Tue, 12 Aug 2025 12:53:03 -0700 Subject: [PATCH 7/7] pr fb --- ...Messaging.EventGrid.SystemEvents.net8.0.cs | 2 -- ...g.EventGrid.SystemEvents.netstandard2.0.cs | 2 -- .../Customization/EventGridModelFactory.cs | 2 ++ .../src/Generated/EventGridModelFactory.cs | 35 ------------------- 4 files changed, 2 insertions(+), 39 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs index bc122a85489d..5e6811a2bb6d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.net8.0.cs @@ -366,7 +366,6 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData ResourceDeleteFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData ResourceDeleteSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, Azure.Core.RequestMethod? method = default(Azure.Core.RequestMethod?), string url = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string methodString = null, string url = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } @@ -401,7 +400,6 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, bool? recursive = default(bool?), string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, string recursiveString = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs index bc122a85489d..5e6811a2bb6d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs @@ -366,7 +366,6 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData ResourceDeleteFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData ResourceDeleteSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, Azure.Core.RequestMethod? method = default(Azure.Core.RequestMethod?), string url = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string methodString = null, string url = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } @@ -401,7 +400,6 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, bool? recursive = default(bool?), string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, string recursiveString = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs index bba6d316d04f..620e996dbc57 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Customization/EventGridModelFactory.cs @@ -25,6 +25,8 @@ namespace Azure.Messaging.EventGrid [CodeGenSuppress("ResourceActionSuccessEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] [CodeGenSuppress("ResourceActionFailureEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] [CodeGenSuppress("ResourceActionCancelEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(JsonElement), typeof(JsonElement), typeof(string), typeof(JsonElement))] + [CodeGenSuppress("StorageDirectoryDeletedEventData", typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(object))] + [CodeGenSuppress("ResourceHttpRequest", typeof(string), typeof(string), typeof(string), typeof(string))] public static partial class EventGridModelFactory { /// Initializes new instance of MediaJobError class. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs index 8be15d97ad6c..836b9658669d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridModelFactory.cs @@ -3506,17 +3506,6 @@ public static ResourceAuthorization ResourceAuthorization(string scope = default return new ResourceAuthorization(scope, action, evidence, additionalBinaryDataProperties: null); } - /// The details of the HTTP request. - /// The client request ID. - /// The client IP address. - /// - /// The url used in the request. - /// A new instance for mocking. - public static ResourceHttpRequest ResourceHttpRequest(string clientRequestId = default, string clientIpAddress = default, string methodString = default, string url = default) - { - return new ResourceHttpRequest(clientRequestId, clientIpAddress, methodString, url, additionalBinaryDataProperties: null); - } - /// Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. /// The namespace name of the Microsoft.ServiceBus resource. /// The endpoint of the Microsoft.ServiceBus resource. @@ -3710,30 +3699,6 @@ public static StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData( additionalBinaryDataProperties: null); } - /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event. - /// The name of the API/operation that triggered this event. - /// A request id provided by the client of the storage API operation that triggered this event. - /// The request id generated by the storage service for the storage API operation that triggered this event. - /// The path to the deleted directory. - /// - /// An opaque string value representing the logical sequence of events for any particular directory name. Users can use standard string comparison to understand the relative sequence of two events on the same directory name. - /// The identity of the requester that triggered this event. - /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - /// A new instance for mocking. - public static StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = default, string clientRequestId = default, string requestId = default, string url = default, string recursiveString = default, string sequencer = default, string identity = default, object storageDiagnostics = default) - { - return new StorageDirectoryDeletedEventData( - api, - clientRequestId, - requestId, - url, - recursiveString, - sequencer, - identity, - storageDiagnostics, - additionalBinaryDataProperties: null); - } - /// Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event. /// The name of the API/operation that triggered this event. /// A request id provided by the client of the storage API operation that triggered this event.